//Son durumdaki yonune gore yeni yon belirleniyor. public void ChangeRotation(string rotation) { if (rotation == "L") { switch (this.rotation) { case HBRotation.North: this.rotation = HBRotation.West; break; case HBRotation.West: this.rotation = HBRotation.South; break; case HBRotation.South: this.rotation = HBRotation.East; break; case HBRotation.East: this.rotation = HBRotation.North; break; } } else if (rotation == "R") { switch (this.rotation) { case HBRotation.North: this.rotation = HBRotation.East; break; case HBRotation.East: this.rotation = HBRotation.South; break; case HBRotation.South: this.rotation = HBRotation.West; break; case HBRotation.West: this.rotation = HBRotation.North; break; } } }
public HBRover(int xCoordinate, int yCoordinate, char firstRote) { this.xCoordinate = xCoordinate; this.yCoordinate = yCoordinate; this.rotation = GetRotation(firstRote); }