PRoConEvents.MULTIbalancer.RemainingTickets C# (CSharp) Method

RemainingTickets() private method

private RemainingTickets ( ) : double
return double
        private double RemainingTickets()
        {
            double ret = 0;
            if (fServerInfo == null || fServerInfo.TeamScores.Count < 2) return 0;

            if (IsConquest() || IsRush()) {
            // Pick lowest ticket count of all teams
            ret = Double.MaxValue;
            foreach (TeamScore ts in fServerInfo.TeamScores) {
            if (ts.Score < ret) ret = ts.Score;
            }
            } else {
            // Picket highest ticket count of all teams
            ret = 0;
            double tmax = 0;
            foreach (TeamScore ts in fServerInfo.TeamScores) {
            if (ts.Score > ret) ret = ts.Score;
            if (ts.WinningScore > tmax) tmax = ts.WinningScore;
            }
            ret = tmax - ret;
            }

            return ret;
        }
MULTIbalancer