public Rover() { coordinate = new Coordinate(); direction = new Direction(); parse = new Parser(); check = new CheckBoundaries(); }
public void ChangeCoordinate(ref Direction direction, ref Coordinate coordinate, ref CheckBoundaries check) { Coordinate coord = _getvalue[direction.Dir]; var direct = new Coordinate() { X = coordinate.X + coord.X, Y = coordinate.Y + coord.Y }; if (check.isvalid(direct.X, direct.Y)) { coordinate.X = direct.X; coordinate.Y = direct.Y; } }