Example #1
0
        public PositionVector Rotate(PositionVector currentPositionVector, char orientation)
        {
            PositionVector updatedPositionVector = currentPositionVector;

            updatedPositionVector = RotateDict[orientation].Rotate(currentPositionVector);

            return(updatedPositionVector);
        }
Example #2
0
        public PositionVector StepForward(PositionVector currentPositionVector, Coordinate maxCoordinateToRove)
        {
            PositionVector updatedPositionVector = currentPositionVector;

            updatedPositionVector = StepForwardDict[currentPositionVector.Direction].StepForward(currentPositionVector, maxCoordinateToRove);

            return(updatedPositionVector);
        }
Example #3
0
        public PositionVector StepForward(PositionVector currentPositionVector, Coordinate maxCoordinateToRove)
        {
            PositionVector updatedPositionVector = currentPositionVector;

            updatedPositionVector.Coordinate.X = currentPositionVector.Coordinate.X + 1;
            if (updatedPositionVector.Coordinate.CheckBounds(maxCoordinateToRove) == false)
            {
                return(updatedPositionVector);
            }
            return(currentPositionVector);
        }
Example #4
0
        public PositionVector Rotate(PositionVector currentPositionVector)
        {
            PositionVector updatedLocationVector = currentPositionVector;

            if ((int)updatedLocationVector.Direction == 0)
            {
                updatedLocationVector.Direction = (Direction)7;
            }
            else
            {
                updatedLocationVector.Direction = (Direction)updatedLocationVector.Direction - 1;
            }

            return(updatedLocationVector);
        }