Exemple #1
0
        // checks if the game is over, respecting the selected victory types
        private Tuple <bool, Player, VictoryType> IsGameOver()
        {
            if (VictoryTypes.Contains(VictoryType.Culture))
            {
                // TODO implement this after tourism is implemented
            }
            if (VictoryTypes.Contains(VictoryType.Diplomatic))
            {
                // TODO implement this after world parliament is implemented
            }
            if (VictoryTypes.Contains(VictoryType.Domination))
            {
                Player winner      = null;
                int    playersLeft = 0;
                foreach (Player player in controllers.Player.GetAllPlayers())
                {
                    if (controllers.City.GetPlayerCities(player.InstanceID).Count > 0 || controllers.Unit.GetPlayerUnits(player.InstanceID).Count > 0)
                    {
                        playersLeft++;
                        winner = player;
                    }
                }

                if (playersLeft == 1)
                {
                    return(new Tuple <bool, Player, VictoryType>(true, winner, VictoryType.Domination));
                }
            }
            if (VictoryTypes.Contains(VictoryType.Science))
            {
                // TODO implement this after space shuttle can be built
            }
            return(new Tuple <bool, Player, VictoryType>(false, null, 0));
        }
    void InitiateVictory(int Team, VictoryTypes VictoryMode)
    {
        for (int i = 0; i < TeamManager.TM.Teams.Count; ++i)
        {
            TeamManager.TM.Teams[i].isTeamActive = false;
        }

        VictoryScreen.SetActive(true);
        WinningTeam.text = "Team " + Team + " is Victorious";
        VictoryType.text = "They won through a " + VictoryMode.ToString() + " victory";
    }