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