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
 private void UIDisconnect_OnDisconnectRobot()
 {
     if (reachedGoal)
     {
         return;
     }
     StartCoroutine(WipeFeed());
     OnRobotLost?.Invoke();
 }