public void Initialize()
        {
            getInstance = this;

            Counter = 0;

            scoreRoot = new Score(0x7FFFFFFF); // ルート(スコアとして換算はしないが重要な役割も持つ):int型の最大の数値を代入する

            scoreRoot.Add(FileIO.LoadScore(SaveName));
        }
Esempio n. 2
0
        public bool Add(Score New)
        {
            // 無限ループの原因となる全く同じインスタンスが来た場合はスルーする
            if (this.Equals(New)) return false;

            // 自身よりも追加する物の方が高い場合
            // 手前に代入する
            if (New.score > this.score) {
                this.back.next = New;
                New.back = this.back;
                New.next = this;
                this.back = New;
                index = -1;
                // 代入した場合はtrueを返す
                return true;
            }
            // 自身以下の場合は後に追加する
            else {
                // 次のオブジェクトがない場合はそのまま代入する
                if (next == null) {
                    this.next = New;
                    New.back = this;
                    New.next = null;
                    index = -1;
                    return true;
                }
                else {
                    index++;
                    if (index > 1000) return false;
                    if (this.next.Add(New))
                        return true;
                }
            }

            return false;
        }
Esempio n. 3
0
 public Score(int di)
 {
     point = di;
     next = null;
     back = null;
 }
Esempio n. 4
0
 public Score()
 {
     point = 0;
     next = null;
     back = null;
 }