Exemple #1
0
        void AnalysisRoundNote(Dictionary <int, string> roundNote, EStageLevel stageLevel)
        {
            foreach (KeyValuePair <int, string> kvp in roundNote)
            {
                AuditionRoundInfo roundInfo = new AuditionRoundInfo();
                roundInfo.RoundNO = kvp.Key;
                string stringNote = kvp.Value;
                bool   IsReverse  = false;
                for (int index = 0; index < stringNote.Length; ++index)
                {
                    string           note     = stringNote.Substring(index, 1);
                    AuditionBallInfo ballInfo = new AuditionBallInfo();
                    if (note[0] == '*')
                    {
                        IsReverse = true;

                        if (stageLevel > EStageLevel.Hard)
                        {
                            if (note.Contains("5"))
                            {
                                roundNote.Remove(kvp.Key);
                            }
                        }
                    }
                    else
                    {
                        int ballIndex = 0;
                        int.TryParse(note, out ballIndex);

                        AuditionBallType ballType = CAuditionBallType.GetBallType(ballIndex);
                        if (IsReverse)
                        {
                            ballInfo.m_bIsReverse = true;
                            IsReverse             = false;
                        }
                        ballInfo.m_BallType = ballType;
                        roundInfo.BallList.Add(ballInfo);
                        if (CAuditionBallType.IsValid(ballType))
                        {
                            if (roundInfo.m_bAllEmpty)
                            {
                                roundInfo.m_bAllEmpty = false;
                            }
                        }
                    }
                }

                RoundInfoMap.Add(kvp.Key, roundInfo);
            }
        }
Exemple #2
0
        public int SpecialTest()
        {
            int retValue = 0;

            foreach (KeyValuePair <int, AuditionRoundInfo> kvp in RoundInfoMap)
            {
                AuditionRoundInfo au = kvp.Value;
                if (au.RoundNO % 2 == 0)
                {
                    if (!au.m_bAllEmpty)
                    {
                        CommonFunc.SetTestError(ref retValue, ETestError.EvenRoundNotZero);
                    }
                }
                else if (IsShowTimeRound(au.RoundNO))
                {
                    if (!au.m_bAllEmpty)
                    {
                        CommonFunc.SetTestError(ref retValue, ETestError.ShowTimeNotZero);
                    }
                }
                else
                {
                    if (!au.m_bAllEmpty)
                    { // 非空节不能存在0.
                        foreach (AuditionBallInfo bt in au.BallList)
                        {
                            if (bt.m_BallType == AuditionBallType.None)
                            {
                                CommonFunc.SetTestError(ref retValue, ETestError.InvalidValue);
                            }
                        }
                    }
                }
            }

            return(retValue);
        }