mirror of
https://github.com/farcasclaudiu/MartianRobots.git
synced 2026-06-28 19:01:06 +03:00
Add project files.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using Ardalis.GuardClauses;
|
||||
|
||||
namespace MartianRobotsSolver
|
||||
{
|
||||
public class RobotInfo
|
||||
{
|
||||
public int PosX { get; set; }
|
||||
public int PosY { get; set; }
|
||||
public string Head { get; set; }
|
||||
public string Commands { get; }
|
||||
public bool IsLost { get; set; } = false;
|
||||
|
||||
public RobotInfo(int posX, int posY, string head, string commands)
|
||||
{
|
||||
Guard.Against.Negative(posX, nameof(posX));
|
||||
Guard.Against.Negative(posY, nameof(posX));
|
||||
this.PosX = posX;
|
||||
this.PosY = posY;
|
||||
this.Head = head;
|
||||
this.Commands = commands;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{PosX} {PosY} {Head}{ (IsLost ? " LOST" : string.Empty) }";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user