示例#1
0
 public void TickExhibition(TeamsConfig teamsConfig)
 {
     if (exhibitionInstance.currentEvalTicket == null)
     {
         // first-time setup:
         ResetExhibitionInstance(teamsConfig);
     }
     else
     {
         if (exhibitionInstance.currentEvalTicket.status == EvaluationTicket.EvaluationStatus.Pending)
         {
         }
         else if (exhibitionInstance.currentEvalTicket.status == EvaluationTicket.EvaluationStatus.InProgress)
         {
             exhibitionInstance.Tick();
         }
         else if (exhibitionInstance.currentEvalTicket.status == EvaluationTicket.EvaluationStatus.PendingComplete)
         {
             ExhibitionNextGenome(teamsConfig);
             exhibitionInstance.ClearInstance();
         }
         else    // Complete
         {
             exhibitionInstance.ClearInstance();
         }
     }
 }
示例#2
0
    public void Tick()
    {
        if (isSimulating)   // && debugFrameCounter < 2) {
        // Check if it's all over:
        {
            if (CheckAllMatchesFinished())
            {
                tournamentFinished = true;
                inbetweenMatches   = true;
                if (!resultsProcessed)
                {
                    AllMatchesComplete();
                    resultsProcessed = true;
                }

                //Debug.Log("Tournament Finished!");
                // END
            }

            // find current match:
            currentMatchup = FindCurrentMatchup();

            // Check if we're between matches:
            if (inbetweenMatches)
            {
                // ShowUI
                gameManager.cameraEnabled = false;
            }
            else
            {
                switch (currentMatchup.evalTicket.status)
                {
                case EvaluationTicket.EvaluationStatus.Pending:
                    //Found it!
                    // inbetweenMatches is false, so ready to start!
                    Debug.Log("SetUp matchup " + currentMatchup.id.ToString());
                    //Debug.Log(tournamentInstance.ToString());
                    //Debug.Log(currentMatchup.ToString());
                    //Debug.Log(currentMatchup.evalTicket.ToString());
                    tournamentInstance.SetUpInstance(currentMatchup.evalTicket, gameManager.trainerRef.teamsConfig, gameManager.trainerRef.evaluationManager.exhibitionParticleCurves);

                    Play();
                    isSimulating = true;
                    gameManager.cameraEnabled = true;
                    break;

                case EvaluationTicket.EvaluationStatus.InProgress:
                    // do stuff
                    // Tick
                    tournamentInstance.Tick();
                    break;

                case EvaluationTicket.EvaluationStatus.PendingComplete:
                    // do stuff
                    // Save Scores
                    for (int i = 0; i < tournamentInstance.agentGameScoresArray.Length; i++)
                    {
                        currentMatchup.contestantScoresArray[0] = tournamentInstance.agentGameScoresArray[0][0];                                       // @$#!@$# ASSUMES 1 Player at a time!! will break for Combat MiniGame!!!
                        Debug.Log("matchup " + currentMatchup.id + ", PendingComplete, score: " + currentMatchup.contestantScoresArray[0].ToString()); // @$#!@$# ASSUMES 1 Player at a time!! will break for Combat MiniGame!!!
                    }
                    //tournamentInstance.agentGameScoresArray[]
                    inbetweenMatches = true;
                    currentMatchup.evalTicket.status = EvaluationTicket.EvaluationStatus.Complete;

                    CalculateLiveResults();
                    // Cleanup?
                    break;

                case EvaluationTicket.EvaluationStatus.Complete:
                    // do stuff
                    // shouldn't happen
                    break;
                }
            }



            //Debug.Log("FixedUpdate isTraining");

            /*if (singleTicket.status == EvaluationTicket.EvaluationStatus.PendingComplete) {
             *  // Pending complete!!!
             *  Debug.Log("PendingComplete!");
             *  isSimulating = false;
             *  Exit();
             * }
             * else {
             *  if (tournamentInstance.currentEvalTicket.status == EvaluationTicket.EvaluationStatus.Pending) {
             *
             *  }
             *  else if (tournamentInstance.currentEvalTicket.status == EvaluationTicket.EvaluationStatus.InProgress) {
             *      tournamentInstance.Tick();
             *  }
             *
             * }*/
            //debugFrameCounter++;
        }
    }