|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectEigenMeat.EigenMaze.EntityFactory
An EntityFactory will store lists of different types of entities loaded by the SoftLoader. Entities are stored as clonable prototypes - any entity that is to be soft-loadable should follow the pattern of the already defined types and have a prototype pattern subclass that implements Clonable for creation (these are package private and thus have no Javadoc). Entities saved in this class must have a getName() method (as part of the Prototype subclass).
Entities are created from this class by cloning. An instance of the fully initialized entity is saved here, and when a new copy of that type of entity is to be created, it is cloned and added to the engine.
| Constructor Summary | |
EntityFactory()
|
|
| Method Summary | |
void |
addEntityType(Entity e)
Add a new entity to be created. |
void |
addType(Projectile p)
Add a new Projectile type to be created. |
void |
addType(Ship s)
Add a new Ship type to be created. |
Entity |
create(java.lang.String name)
Create a new entity based on the entity stored under the given name. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public EntityFactory()
| Method Detail |
public void addEntityType(Entity e)
public void addType(Ship s)
public void addType(Projectile p)
public Entity create(java.lang.String name)
name - the name of the entity type to be created.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||