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; }
//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++; }
public LevelNumber(int amount) { this.amount = amount; this.next = null; this.group = 0; }