예제 #1
0
        private bool verifyAndCompileCode()
        {
            List <string> codeLines = getLinesFromString(ProgramCode);

            MovementCmnds.Clear();
            ConditionalCmnds.Clear();

            bool result = verifyCodeBegin(codeLines) && verifyCodeEnd(codeLines) && verifyAndCompileCodeLines(codeLines);

            return(result);
        }
예제 #2
0
        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);
        }
예제 #3
0
 // Registering View Items Commands into bindinglist
 public void AddToCommandList(MoveCommand mc)
 {
     MovementCmnds.Add(mc);
 }