swarm-0.5.0.0: 2D resource gathering game with programmable robots
LicenseBSD-3-Clause
Safe HaskellSafe-Inferred
LanguageHaskell2010

Swarm.Game.Scenario.Topography.Navigation.Waypoint

Description

Landmarks that are used to specify portal locations and can serve as navigation aids via the waypoint command.

Waypoint ordering

The sequence of waypoints of a given name is dictated by criteria in the following order:

  1. Ordering of structure placements (see implementation of mergeStructures); later placements are ordered first.
  2. Placement of cells within a map. Map locations go by row-major order (compare to docs for genRobotTemplates).

TODO (#1366): May be useful to have a mechanism for more precise control of ordering.

Synopsis

Documentation

data Originated a Source #

Indicates which structure something came from for debugging purposes.

Constructors

Originated 

Fields

Instances

Instances details
Functor Originated Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Navigation.Waypoint

Methods

fmap :: (a -> b) -> Originated a -> Originated b #

(<$) :: a -> Originated b -> Originated a #

Show a => Show (Originated a) Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Navigation.Waypoint

Eq a => Eq (Originated a) Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Navigation.Waypoint

Methods

(==) :: Originated a -> Originated a -> Bool #

(/=) :: Originated a -> Originated a -> Bool #

newtype WaypointName Source #

Constructors

WaypointName Text 

Instances

Instances details
FromJSON WaypointName Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Navigation.Waypoint

Generic WaypointName Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Navigation.Waypoint

Associated Types

type Rep WaypointName :: Type -> Type #

Show WaypointName Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Navigation.Waypoint

Eq WaypointName Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Navigation.Waypoint

Ord WaypointName Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Navigation.Waypoint

type Rep WaypointName Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Navigation.Waypoint

type Rep WaypointName = D1 ('MetaData "WaypointName" "Swarm.Game.Scenario.Topography.Navigation.Waypoint" "swarm-0.5.0.0-6qXEbhCmuXA4wRndqqhBu" 'True) (C1 ('MetaCons "WaypointName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data Waypoint Source #

A parent world shouldn't have to know the exact layout of a subworld to specify where exactly a portal will deliver a robot to within the subworld. Therefore, we define named waypoints in the subworld and the parent world must reference them by name, rather than by coordinate.

Constructors

Waypoint 

Instances

Instances details
FromJSON Waypoint Source #

JSON representation is flattened; all keys are at the same level, in contrast with the underlying record.

Instance details

Defined in Swarm.Game.Scenario.Topography.Navigation.Waypoint

Show Waypoint Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Navigation.Waypoint

Eq Waypoint Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Navigation.Waypoint

modifyLocation :: (Location -> Location) -> Waypoint -> Waypoint Source #

Basically "fmap" for the Location field

offsetWaypoint :: V2 Int32 -> Waypoint -> Waypoint Source #

Translation by a vector