예제 #1
0
    public void Initialize(TeamsConfig teamsConfig, TournamentInfo tournamentInfo)
    {
        Debug.Log("TournamentManager Initialize");
        currentTournamentInfo = tournamentInfo;

        // Load Competitors,
        // Create Match Schedule
        // Process Tournament Info:
        tournamentInfo.PrepareTournament(teamsConfig.playersList[0].agentGenomeList[0]);

        gameManager.prestige -= tournamentInfo.entranceFee;

        // Set up Exhibition Instance:
        if (tournamentInstance == null)
        {
            GameObject tournamentInstanceGO = new GameObject("TournamentInstance");
            tournamentInstance = tournamentInstanceGO.AddComponent <EvaluationInstance>();
            tournamentInstance.transform.position = new Vector3(0f, 0f, 0f);
            tournamentInstance.visible            = true;
            tournamentInstance.isExhibition       = true;
        }
        else
        {
            tournamentInstance.gameObject.SetActive(true);
        }
    }
예제 #2
0
    public void InitializeNewTraining(TeamsConfig teamsConfig)
    {
        // Set up eval tickets:
        evaluationTicketList = new List <EvaluationTicket>();
        exhibitionTicketList = new List <EvaluationTicket>();
        //evaluationTicketQueue = new Queue<EvaluationTicket>();

        // Set up Exhibition Instance:
        GameObject exhibitionInstanceGO = new GameObject("ExhibitionInstance");

        exhibitionInstance = exhibitionInstanceGO.AddComponent <EvaluationInstance>();
        exhibitionInstance.transform.position = new Vector3(0f, 0f, 0f);
        exhibitionInstance.visible            = true;
        exhibitionInstance.isExhibition       = true;

        CreateEvaluationInstances();

        CreateDefaultEvaluationTickets(teamsConfig); // creates combinatorics for each Population's representatives
        InitializeExhibitionTickets(teamsConfig);

        Debug.Log("EvalManager Initialized!");
    }
예제 #3
0
    public void CreateEvaluationInstances()
    {
        // Set up Evaluation Instances:

        Vector3 arenaBounds = new Vector3(40f, 40f, 40f); //Challenge.GetChallengeArenaBounds(challengeType); // revisit this method

        evaluationInstancesList = new List <EvaluationInstance>();

        for (int x = 0; x < maxInstancesX; x++)
        {
            for (int y = 0; y < maxInstancesY; y++)
            {
                int yRowPosition = y - Mathf.RoundToInt((float)maxInstancesY * 0.5f);
                if (yRowPosition >= 0)
                {
                    yRowPosition++;
                }
                float yPos = (yRowPosition) * (arenaBounds.y + instanceBufferY);
                for (int z = 0; z < maxInstancesZ; z++)
                {
                    GameObject         evalInstanceGO     = new GameObject("EvaluationInstance [" + x.ToString() + "," + z.ToString() + "]");
                    EvaluationInstance evaluationInstance = evalInstanceGO.AddComponent <EvaluationInstance>();
                    //evaluationInstance.particleCurves = particleTrajectories;

                    float xPos = (x + 1) * (arenaBounds.x + instanceBufferX) - ((float)maxInstancesX * 0.5f) * (arenaBounds.x + instanceBufferX);
                    float zPos = (z + 1) * (arenaBounds.z + instanceBufferZ) - ((float)maxInstancesZ * 0.5f) * (arenaBounds.z + instanceBufferZ);

                    evalInstanceGO.transform.position = new Vector3(xPos, yPos, zPos);
                    evalInstanceGO.transform.position = new Vector3(42f, 0f, zPos);
                    evaluationInstancesList.Add(evaluationInstance);

                    evaluationInstance.isExhibition = false;
                }
            }
        }
    }