Back to project page LucyTheMoocher.
The source code is released under:
MIT License
If you think the Android project LucyTheMoocher listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.lucythemoocher.actors; // w ww .j ava 2 s .c o m import java.util.ArrayList; import java.util.Iterator; /** * * @author gloups * */ public class MonstersManager { private ArrayList<Monster> monsters_; public MonstersManager() { monsters_ = new ArrayList<Monster>(); } public void update() { Iterator<Monster> it = getIterator(); while(it.hasNext()) { Monster monster = it.next(); if (monster.isToRemove()) { it.remove(); continue; } monster.update(); } } public void render() { for (Monster monster: monsters_) { monster.draw(); } } public void addMonster(Monster monster) { monsters_.add(monster); } public Iterator<Monster> getIterator() { return monsters_.iterator(); } }