public ISet <CharMovement.Direction> BlockedDirections(Vector2Int cell) { var blocked = CharMovement.DIRECTIONS.Where( direction => IsBlocked(cell + CharMovement.GetDirectionVector2D(direction))); return(new HashSet <CharMovement.Direction>(blocked)); }
private bool IsBlockedTorwards(Direction?direction) { var nextCell = this.Cell + CharMovement.GetDirectionVector2D(direction.Value); var isBlocked = direction.HasValue && this.grid.IsBlocked(nextCell); return(isBlocked); }
public bool[] UnblockedDirections(Vector2Int cell) { return(CharMovement.DIRECTIONS.Select( direction => IsBlocked(cell + CharMovement.GetDirectionVector2D(direction))) .ToArray()); }