Beispiel #1
0
        public MatchScore GetRandomScoreTeam()
        {
            if (!m_isTeam)
            {
                return(null);
            }
            MatchScore matchScore = new MatchScore();

            matchScore.RandomScore(m_rand, m_maxSetCount, m_finishFullSets);                                                 //随机大比分分数和胜负
            int[] winArray = GetRandomWinnerArray(m_rand, matchScore.MatchScoreA, matchScore.MatchScoreB, m_finishFullSets); //根据比分,随机一个Set胜负数组
            foreach (int winSetA in winArray)
            {
                SetScore setScore = new SetScore();
                setScore.RandomScore(m_rand, m_maxGameCount, winSetA);                                  //随机一个Set比分
                int[] gameArray = GetRandomWinnerArray(m_rand, setScore.SetScoreA, setScore.SetScoreB); //根据随机的Set比分随机一个Game胜负数组
                foreach (int winGameA in gameArray)
                {
                    GameScore gameScore = new GameScore();
                    gameScore.RandomScore(m_rand, m_gamePoints, Probability(10), winGameA);//给予10%的概率出现追分
                    setScore.Add(gameScore);
                }
                matchScore.Add(setScore);
            }
            return(matchScore);
        }
Beispiel #2
0
        public SetScore GetRandomScoreSet()
        {
            if (m_isTeam)
            {
                return(null);
            }
            SetScore setScore = new SetScore();

            setScore.RandomScore(m_rand, m_maxGameCount);
            int[] gameArray = GetRandomWinnerArray(m_rand, setScore.SetScoreA, setScore.SetScoreB);
            foreach (int winGameA in gameArray)
            {
                GameScore gameScore = new GameScore();
                gameScore.RandomScore(m_rand, m_gamePoints, Probability(10), winGameA);
                setScore.Add(gameScore);
            }
            return(setScore);
        }