Пример #1
0
        public static BoardLocation?Neighbor(this BoardLocation currentLocation, Direction direction)
        {
            switch (direction)
            {
            case Direction.East:
                return(currentLocation.East());

            case Direction.North:
                return(currentLocation.North());

            case Direction.NorthEast:
                return(currentLocation.NorthEast());

            case Direction.NorthWest:
                return(currentLocation.NorthWest());

            case Direction.South:
                return(currentLocation.South());

            case Direction.SouthEast:
                return(currentLocation.SouthEast());

            case Direction.SouthWest:
                return(currentLocation.SouthWest());

            case Direction.West:
                return(currentLocation.West());

            default:
                return(null);
            }
        }