示例#1
0
        private bool shouldSkipClanPlayer(PlayerProfile player, int smaller_team, int bigger_team, Dictionary<string, int>[] clan_stats) {
            string tag = player.getClanTag();

            if (!clan_stats[bigger_team].ContainsKey(tag))
                clan_stats[bigger_team].Add(tag, 0);

            if (!clan_stats[smaller_team].ContainsKey(tag))
                clan_stats[smaller_team].Add(tag, 0);

            if (player.isInClan() && (clan_stats[bigger_team][tag] + clan_stats[smaller_team][tag]) > 1) {
                /* if the majority of the players in the clan are in this team, skip this player */
                if (clan_stats[bigger_team][tag] >= clan_stats[smaller_team][tag]) {
                    DebugWrite("Skipping clan-player ^b" + player + "^n because majority of clan is in his team", 3);
                    return true;
                }

                /* update the clan stats */
                clan_stats[bigger_team][tag]--;
                clan_stats[smaller_team][tag]++;
            }
            return false;
        }