Exemplo n.º 1
0
    private void ExecuteCommand(float nextCommandInSeconds, bool draw = true)
    {
        if (instructionsFeed.Count == 0)
        {
            OnRobotLost?.Invoke();
            return;
        }
        RobotCommand cmd = instructionsFeed[0].command;

        instructionsFeed.RemoveAt(0);
        if (cmd != RobotCommand.NONE)
        {
            trashDeck.Add(cmd);
        }

        if (!reachedGoal)
        {
            OnSendCommand?.Invoke(cmd, nextCommandInSeconds);
        }
        if (draw)
        {
            DrawToFeed();
        }
        else
        {
            SendSynchFeed();
        }
    }
Exemplo n.º 2
0
 public bool SendCommand(enuUnitCommand Cmd, byte Par, ushort Pr2)
 {
     OnSendCommand?.Invoke(null, new SendCommandEventArgs()
     {
         Cmd = Cmd, Par = Par, Pr2 = Pr2
     });
     return(true);
 }
Exemplo n.º 3
0
 public void SendCommand(string dmcc)
 {
     OnSendCommand?.Invoke(this, dmcc);
 }