C# Class Dwarrowdelf.EnvironmentExtensions

Mostrar archivo Open project: tomba/dwarrowdelf Class Usage Examples

Public Methods

Method Description
AdjustMoveDir ( this env, IntVector3 location, Direction dir ) : Direction

For PlanarUpDown directions, return Direction.None if the direction cannot be entered, or the direction, adjusted by slopes (i.e. or'ed with Up or Down)

CanBeSeen ( this env, IntVector3 location ) : bool

Can the given tile be seen from any adjacent tile

CanEnter ( this env, IntVector3 location ) : bool

Tile can be entered and stood upon

CanMoveFrom ( this env, IntVector3 srcLoc, Direction dir ) : bool

Determine if a living can move from srcLoc to dir, without considering the destination

CanMoveFromTo ( this env, IntVector3 srcLoc, Direction dir ) : bool

Determine if a living can move from srcLoc to dir

CanMoveTo ( this env, IntVector3 dstLoc, Direction dir ) : bool

Determine if a living can move to dir, ending to dstLoc, without considering the source

GetDirectionsFrom ( this env, IntVector3 p ) : IEnumerable

Return all possible move directions. XXX Some room for optimization...

GetPositioningLocations ( this env, IntVector3 pos, DirectionSet positioning ) : IEnumerable

Return enterable positions around the given location, based on positioning

GetPossibleMiningPositioning ( this env, IntVector3 p, MineActionType mineActionType ) : DirectionSet

Get possible positioning to perform mining to given location

Method Details

AdjustMoveDir() public static method

For PlanarUpDown directions, return Direction.None if the direction cannot be entered, or the direction, adjusted by slopes (i.e. or'ed with Up or Down)
public static AdjustMoveDir ( this env, IntVector3 location, Direction dir ) : Direction
env this
location IntVector3
dir Direction
return Direction

CanBeSeen() public static method

Can the given tile be seen from any adjacent tile
public static CanBeSeen ( this env, IntVector3 location ) : bool
env this
location IntVector3
return bool

CanEnter() public static method

Tile can be entered and stood upon
public static CanEnter ( this env, IntVector3 location ) : bool
env this
location IntVector3
return bool

CanMoveFrom() public static method

Determine if a living can move from srcLoc to dir, without considering the destination
public static CanMoveFrom ( this env, IntVector3 srcLoc, Direction dir ) : bool
env this
srcLoc IntVector3
dir Direction
return bool

CanMoveFromTo() public static method

Determine if a living can move from srcLoc to dir
public static CanMoveFromTo ( this env, IntVector3 srcLoc, Direction dir ) : bool
env this
srcLoc IntVector3
dir Direction
return bool

CanMoveTo() public static method

Determine if a living can move to dir, ending to dstLoc, without considering the source
public static CanMoveTo ( this env, IntVector3 dstLoc, Direction dir ) : bool
env this
dstLoc IntVector3
dir Direction
return bool

GetDirectionsFrom() public static method

Return all possible move directions. XXX Some room for optimization...
public static GetDirectionsFrom ( this env, IntVector3 p ) : IEnumerable
env this
p IntVector3
return IEnumerable

GetPositioningLocations() public static method

Return enterable positions around the given location, based on positioning
public static GetPositioningLocations ( this env, IntVector3 pos, DirectionSet positioning ) : IEnumerable
env this
pos IntVector3
positioning DirectionSet
return IEnumerable

GetPossibleMiningPositioning() public static method

Get possible positioning to perform mining to given location
public static GetPossibleMiningPositioning ( this env, IntVector3 p, MineActionType mineActionType ) : DirectionSet
env this
p IntVector3
mineActionType MineActionType
return DirectionSet