public TortoiseCompiler AddMoveCommand(string direction, string distance) { MoveDirection dir = MoveDirection.BWD; string fwdString = Enum.GetName(typeof(MoveDirection), MoveDirection.FWD); if(direction.ToUpper().Equals(fwdString)) { dir = MoveDirection.FWD; } float dist = float.Parse(distance); MoveCommand moveCommand = new MoveCommand(dir, dist); _commands.Add(moveCommand); return this; }
public TortoiseCompiler AddMoveCommand(string direction, string distance) { MoveDirection dir = MoveDirection.BWD; string fwdString = Enum.GetName(typeof(MoveDirection), MoveDirection.FWD); if (direction.ToUpper().Equals(fwdString)) { dir = MoveDirection.FWD; } float dist = float.Parse(distance); MoveCommand moveCommand = new MoveCommand(dir, dist); _commands.Add(moveCommand); return(this); }