Example #1
0
    public ISet <CharMovement.Direction> BlockedDirections(Vector2Int cell)
    {
        var blocked = CharMovement.DIRECTIONS.Where(
            direction => IsBlocked(cell + CharMovement.GetDirectionVector2D(direction)));

        return(new HashSet <CharMovement.Direction>(blocked));
    }
Example #2
0
    private bool IsBlockedTorwards(Direction?direction)
    {
        var nextCell  = this.Cell + CharMovement.GetDirectionVector2D(direction.Value);
        var isBlocked = direction.HasValue && this.grid.IsBlocked(nextCell);

        return(isBlocked);
    }
Example #3
0
 public bool[] UnblockedDirections(Vector2Int cell)
 {
     return(CharMovement.DIRECTIONS.Select(
                direction => IsBlocked(cell + CharMovement.GetDirectionVector2D(direction)))
            .ToArray());
 }