Module
Screeps.Path
- Package
- purescript-screeps-classy
- Repository
- purescript/purescript-screeps
This module implements PathFinder API.
WARNING: While PathFinder accepts any number of target objects, excessive GC may occur if there are too many. API author advises to sort targets by uniform distance [Screeps.Coord], and use only first 10 or so.
#unwalkable Source
unwalkable :: TileCost
Indicates an unwalkable tile.
#PathFinderResult Source
newtype PathFinderResult
Constructors
PathFinderResult { cost :: Int, incomplete :: Boolean, opts :: Int, path :: Array RoomPosition }
#inRange Source
inRange :: Int -> RoomPosition -> PathFinderTarget
#search Source
search :: forall e. RoomPosition -> Array PathFinderTarget -> (PathFinderOpts e) -> Eff (path :: PATH | e) PathFinderResult
#newCostMatrix Source
newCostMatrix :: forall e. Eff (path :: PATH | e) CostMatrix
#defaultPathFinderOpts Source
defaultPathFinderOpts :: forall a. PathFinderOpts a
#RoomCallback Source
type RoomCallback e = RoomName -> Eff (path :: PATH | e) CostMatrix
#allDefaultCosts Source
allDefaultCosts :: forall e. RoomCallback e
Empty callback - just use default terrain cost.
#PathFinderOpts Source
newtype PathFinderOpts e
Constructors
PathFinderOpts { flee :: Boolean, heuristicWeight :: Number, maxCost :: Number, maxOps :: Int, maxRooms :: Int, plainCost :: TileCost, roomCallback :: RoomCallback e, swampCost :: TileCost }
#clone Source
clone :: forall e. CostMatrix -> Eff (path :: PATH | e) CostMatrix
Clone cost matrix.
#SerializedCostMatrix Source
newtype SerializedCostMatrix
Serialized cost matrix, suitable for JSON.stringify
.
Constructors
Instances
#serialize Source
serialize :: CostMatrix -> SerializedCostMatrix
Serialize cost matrix for storage in Memory
.
#deserialize Source
deserialize :: forall e. SerializedCostMatrix -> Eff (err :: EXCEPTION | e) CostMatrix
- Modules
- Screeps
- Screeps.
BodyPartType - Screeps.
Color - Screeps.
Constants - Screeps.
ConstructionSite - Screeps.
Container - Screeps.
Controller - Screeps.
Coolsdown - Screeps.
Coord - Screeps.
Creep - Screeps.
Decays - Screeps.
Deposit - Screeps.
Destructible - Screeps.
Direction - Screeps.
Effects - Screeps.
Extension - Screeps.
Extractor - Screeps.
FFI - Screeps.
FindType - Screeps.
Flag - Screeps.
Game - Screeps.
Id - Screeps.
IntMap - Screeps.
KeeperLair - Screeps.
Lab - Screeps.
Link - Screeps.
Map - Screeps.
Market - Screeps.
Memory - Screeps.
Mineral - Screeps.
Names - Screeps.
Nuke - Screeps.
Nuker - Screeps.
Observer - Screeps.
Owned - Screeps.
Path - Screeps.
Path. Cache - Screeps.
Portal - Screeps.
PowerBank - Screeps.
PowerSpawn - Screeps.
Progress - Screeps.
Rampart - Screeps.
Refillable - Screeps.
Regenerates - Screeps.
Resource - Screeps.
ReturnCode - Screeps.
Road - Screeps.
Room - Screeps.
RoomObject - Screeps.
RoomPosition - Screeps.
RoomPosition. Type - Screeps.
Source - Screeps.
Spawn - Screeps.
Storage - Screeps.
Stores - Screeps.
Structure - Screeps.
Terminal - Screeps.
Tower - Screeps.
Types - Screeps.
Wall