private Rover GenerateRover(int positionX, int positionY, FacingTypes facingTo) { var roverInitialState = new RoverState(positionX, positionY, facingTo); var roverContext = new RoverContext(roverInitialState); return(new Rover(roverContext)); }
public void ChangePosition(FacingTypes facing) { switch (facing) { case FacingTypes.East: PositionY++; break; case FacingTypes.South: PositionX++; break; case FacingTypes.West: PositionY--; break; case FacingTypes.North: PositionX--; break; } }
public RoverState(int positionX, int positionY, FacingTypes facingTo) { this.PositionX = positionX; this.PositionY = positionY; this.CurrentFacing = facingTo; }
private void ChangeCurrentFacing(FacingTypes facingTo) { CurrentFacing = facingTo; }
public RoverFacing(FacingTypes roverFacing) { ChangeCurrentFacing(roverFacing); }