public void PushHeap() { ListIterator<int> pushHeapIt = FourTwoThreeOne.Begin().Copy( FourTwoThreeOne.End(), arrLong.Begin()); pushHeapIt.SetCurrent(5); pushHeapIt = pushHeapIt.GetNext(); arrLong.Begin().PushHeap(pushHeapIt, IsIntLessThanInt); Assert.That(arrLong, Is.EqualTo(new [] { 5, 4, 3, 1, 2, 0, 0, 0 })); }
protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); spriteBatch.Begin(); Iterator<IControl> IteratorList = new ListIterator<IControl>(this.controlList); IOption<IControl> ListItem = IteratorList.GetNext(); ControlVisitor controlVisitor = new ControlVisitor(); // This should have a vistor that returns a bool while (ListItem.isNone() == false && ListItem.getValue().Visit(controlVisitor)) { IControl control = ListItem.getValue(); control.Draw(spriteBatch, this.font, this.buttonStates); ListItem = IteratorList.GetNext(); } spriteBatch.End(); base.Draw(gameTime); }