Пример #1
0
        public Position MoveNorth(Position position)
        {
            var newPosition = position;

            newPosition.IncrementY();
            if (!Plateau.isValid(newPosition))
            {
                throw new InvalidOperationException();
            }
            return(newPosition);
        }
Пример #2
0
        public Position MoveWest(Position position)
        {
            var newPosition = position;

            newPosition.DecrementX();
            if (!Plateau.isValid(newPosition))
            {
                throw new InvalidOperationException();
            }
            return(newPosition);
        }