Beispiel #1
0
        //strategy assumes starting point is south-west
        public override bool Place(int x, int y)
        {
            if (!x.Equals(_x) || !y.Equals(_y))
            {
                return(false);
            }

            _currentPosition = new Position
            {
                X = x,
                Y = y
            };

            _currentOrientation = new NorthOrientationStrategy();

            Report("placed");

            return(true);
        }
Beispiel #2
0
        public override void ChangeRight()
        {
            _currentOrientation = _currentOrientation.TurnRight();

            Report("turned right");
        }
Beispiel #3
0
        public override void ChangeLeft()
        {
            _currentOrientation = _currentOrientation.TurnLeft();

            Report("turned left");
        }