private void ItemUpdateAndRemoval(List <IItems> items, GameTime gt) { for (int i = 0; i < items.Count; i++) { IItems block = (IItems)items[i]; block.Update(gt); if (block.isUsed) { items.Remove(block); } } }
protected override void Update(GameTime gameTime) { foreach (IController controller in controllers) { controller.Update(); } player.Update(); //enemy if (enemies1.Count > 0) { enemy = enemies1.Peek(); } enemy.Update(); //item if (items1.Count > 0) { item = items1.Peek(); } item.Update(); base.Update(gameTime); }