swarm-0.7.0.0: 2D resource gathering game with programmable robots
LicenseBSD-3-Clause
Safe HaskellNone
LanguageHaskell2010

Swarm.Game.Step.Path.Walkability

Description

Walkability logic

Synopsis

Documentation

data MoveFailureMode Source #

Constructors

PathBlockedBy (Maybe Entity)

Can't move due to something blocking the path. Note that if the robot has a path Whitelist, then the absence of an entity could block the path (represented by `PathBlockedBy Nothing`).

PathLiquid Entity

Some liquid entity is in the path.

checkUnwalkable :: WalkabilityContext -> Maybe Entity -> Maybe MoveFailureMode Source #

Pure logic used inside of checkMoveFailureUnprivileged. Given a (possibly empty) walkable entity whitelist or blacklist, and the entity (or lack thereof) in the cell we are trying to move to, determine whether there is some kind of movement failure.