private bool verifyAndCompileCode() { List <string> codeLines = getLinesFromString(ProgramCode); MovementCmnds.Clear(); ConditionalCmnds.Clear(); bool result = verifyCodeBegin(codeLines) && verifyCodeEnd(codeLines) && verifyAndCompileCodeLines(codeLines); return(result); }
private bool verifyAndAddMovmentCommand(Direction direction, int movementLength) { if (!verifyCommandParametersValid(direction, movementLength)) { return(false); } if (direction == Direction.Forward || direction == Direction.Backward) { MovementCmnds.Add(new MoveCommand(direction, movementLength)); } else { for (int i = 0; i < movementLength / 90; i++) { MovementCmnds.Add(new MoveCommand(direction, 90)); } } UpdatePath(); return(true); }
// Registering View Items Commands into bindinglist public void AddToCommandList(MoveCommand mc) { MovementCmnds.Add(mc); }