Skip to content

Instantly share code, notes, and snippets.

@explorer14
Last active June 24, 2020 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save explorer14/aeb856e067789b725664850102357c0f to your computer and use it in GitHub Desktop.
Save explorer14/aeb856e067789b725664850102357c0f to your computer and use it in GitHub Desktop.
public readonly struct RoverCommandParameters
{
public RoverCommandParameters(
int terrainMaxX,
int terrainMaxY,
int currentRoverPositionX,
int currentRoverPositionY,
Direction currentRoverHeading,
params RoverCommands[] manouvreCommands)
{
Terrain = new Terrain(terrainMaxX, terrainMaxY);
RoverInitialisationParameters = new RoverInitialisationParameters(
currentRoverPositionX,
currentRoverPositionY,
currentRoverHeading);
ManouvreCommands = manouvreCommands;
}
public Terrain Terrain { get; }
public RoverInitialisationParameters RoverInitialisationParameters { get; }
public RoverCommands[] ManouvreCommands { get; }
}
public enum RoverCommands
{
TurnLeft = 0,
TurnRight = 1,
Move = 2
}
public readonly struct RoverInitialisationParameters
{
public RoverInitialisationParameters(
int currentRoverPositionX,
int currentRoverPositionY,
Direction currentRoverHeading)
{
CurrentRoverPositionX = currentRoverPositionX;
CurrentRoverPositionY = currentRoverPositionY;
CurrentRoverHeading = currentRoverHeading;
}
public int CurrentRoverPositionX { get; }
public int CurrentRoverPositionY { get; }
public Direction CurrentRoverHeading { get; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment