Exemple #1
0
        public Level()
        {
            this.head = new LevelNumber(0);
            this.tail = new LevelNumber(1000000);
            this.head.Next = this.tail;
            count = 2;

            this.InsertBeforeTail(1000);
            this.InsertBeforeTail(2000);
            this.InsertBeforeTail(5000);
            this.InsertBeforeTail(10000);
            this.InsertBeforeTail(15000);
            this.InsertBeforeTail(25000);
            this.InsertBeforeTail(50000);
            this.InsertBeforeTail(75000);

            this.currentLevel = this.head;
        }
Exemple #2
0
        //Insert in between head and tail
        private void InsertBeforeTail(int amount)
        {
            LevelNumber current  = this.head;

            while(current.Next != this.tail)
            {
                current  = current.Next;

            }

            LevelNumber toInsert = new LevelNumber(amount);

            toInsert.Next = this.tail;
            current.Next = toInsert;
            this.count++;
        }
Exemple #3
0
 public LevelNumber(int amount)
 {
     this.amount = amount;
     this.next = null;
     this.group = 0;
 }