Beispiel #1
0
        public TeamColorEnum GetWinner()
        {
            List<CharacterFighter> bluePlayers = BlueTeam.GetCharacterFighters(true);
            if (bluePlayers.Count > 0 && bluePlayers.All(x => x.HasLeft))
                return TeamColorEnum.RED_TEAM;

            List<CharacterFighter> redPlayers = RedTeam.GetCharacterFighters(true);
            if (redPlayers.Count > 0 && redPlayers.All(x => x.HasLeft))
                return TeamColorEnum.BLUE_TEAM;

            if (BlueTeam.GetFighters().Alives().Count == 0)
            {
                return TeamColorEnum.RED_TEAM;
            }
            else if (RedTeam.GetFighters().Alives().Count == 0)
            {
                return TeamColorEnum.BLUE_TEAM;
            }
            Logger.Error("Try to define winner but fight is running...");
            return 0;

        }