コード例 #1
0
        public int GetNumOfQuestionsofBoss()
        {
            //ボスの問題個数
            QuestionFileManager file = new QuestionFileManager(filenameExceptPath + "Boss");

            return(file.GetNumOfQuestions());
        }
コード例 #2
0
    void Start()
    {
        FileSystem.SaveLoadManager save = new FileSystem.SaveLoadManager();
        save.GetScore(CurrentlyUserInfo.selectedLevel, ref myHighScore_RealValue, ref myBossHighScore_RealValue);
        myScore_RealValue = CurrentlyUserInfo.score;
        if (CurrentlyUserInfo.bBoss)
        {
            myBossScore_RealValue = CurrentlyUserInfo.bossScore;
            bBoss = true;
        }
        //問題の個数
        FileSystem.QuestionFileManager questionMng = new FileSystem.QuestionFileManager("Lesson" + CurrentlyUserInfo.selectedLevel);
        questionLength     = questionMng.GetNumOfQuestions();
        bossquestionLength = questionMng.GetNumOfQuestionsofBoss();

        //HighScore更新
        if (myHighScore_RealValue < myScore_RealValue)
        {
            myHighScore_RealValue       = myScore_RealValue;
            newScoreDisplayText.enabled = true;
        }
        //boss highscore
        if (myBossHighScore_RealValue < myBossScore_RealValue)
        {
            myBossHighScore_RealValue   = myBossScore_RealValue;
            newScoreDisplayText.enabled = true;
        }

        //ファイル更新
        save.SetScore(CurrentlyUserInfo.selectedLevel, (int)myHighScore_RealValue, (int)myBossHighScore_RealValue);

        //現在のユーザー情報を初期化
        CurrentlyUserInfo.DeleteAll();

        //表示するためのvalue
        myScore_DisplayValue         = 0;
        myBossScore_DisplayValue     = 0;
        myHighScore_DisplayValue     = 0;
        myBossHighScore_DisplayValue = 0;
        UpdateScoreText();
    }
コード例 #3
0
        /*レートを取得*/
        public int GetRate()
        {
            string line;
            int    myRate = 1;

            using (StreamReader theReader = new StreamReader(filename))
            {
                int rate = 1;
                do
                {
                    line = theReader.ReadLine();

                    //rateの点数をチェック
                    if (line == '#' + rate.ToString())
                    {
                        line = theReader.ReadLine();

                        //該当する問題のファイル
                        QuestionFileManager q = new QuestionFileManager("Lesson" + rate);

                        //点数が合格点を超える
                        if (int.Parse(line) >= q.GetPassScore())
                        {
                            myRate = rate + 1;
                        }
                        ++rate;
                    }
                } while (theReader.Peek() >= 0);
            }

            if (myRate > MAXLEVEL)
            {
                myRate = MAXLEVEL;
            }
            return(myRate);
        }