Esempio n. 1
0
    public void OnBattleEnds()
    {
        if (!callToEnd)
        {
            callToEnd = true;

            foreach (Soldier soldier in playerTeamData.GetSoldiers())
            {
                soldier.SetReadyToFight(false);
            }
            foreach (Soldier soldier in AITeamData.GetSoldiers())
            {
                soldier.SetReadyToFight(false);
            }

            // Calculate score
            int score = scoreController.CalculateScoreRelativeToAI(playerTeamData, AITeamData);

            // Comunicate score to IA
            aiController.OnBattleEnd(playerController.GetPlayerFormation(), score);

            UtilityObjectData.ConvertArray(aiController.GetTeamFormer().GetUtility());

            unitsPool.Reset();
            playerTeamData.ClearSoldiers();
            AITeamData.ClearSoldiers();

            //-----------------------------------------------------------------------------------------------------------------------------------------------
            // FOR AUTOMATIC KNOWLEDGE

            if (currentGameMode == GameMode.AivsAi)
            {
                OnStartBattle();
            }

            //-----------------------------------------------------------------------------------------------------------------------------------------------
        }
    }