Skip to content

Instantly share code, notes, and snippets.

@explorer14

explorer14/RoverCommandParams.cs Secret

Last active Jun 24, 2020
Embed
What would you like to do?
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
You can’t perform that action at this time.