CompleteConstructionManager<E>, SimpleConstructionManager<T>public class ConstructionManager<T extends be.yildizgames.engine.feature.entity.Entity,E extends be.yildizgames.engine.feature.entity.EntityInConstruction,D> extends be.yildizgames.common.frame.EndFrameListener implements CompleteConstructionManager<E>
| Constructor | Description |
|---|---|
ConstructionManager(be.yildizgames.common.frame.FrameManager frame,
EntityFactory<T,E> factory,
be.yildizgames.engine.feature.entity.EntityCreator creator) |
Create a new BuilderManager.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
cancel(WaitingEntity w) |
Cancel an entity to build.
|
void |
createEntity(be.yildizgames.engine.feature.entity.EntityToCreate entity) |
|
void |
createEntity(E entity,
be.yildizgames.common.model.EntityId builderId,
int index) |
Build an entity without any waiting time.
|
boolean |
frameEnded(long time) |
Call the building logic for all builder in the list.
|
List<WaitingEntity> |
getEntityToBuildList() |
|
List<WaitingEntity> |
getEntityToBuildList(be.yildizgames.common.model.PlayerId player) |
|
void |
removeListener(ConstructionListener listener) |
Remove a listener to notify when a construction is completed.
|
void |
willNotify(ConstructionListener... listeners) |
Add one or several listener to notify when a construction is completed.
|
public ConstructionManager(be.yildizgames.common.frame.FrameManager frame,
EntityFactory<T,E> factory,
be.yildizgames.engine.feature.entity.EntityCreator creator)
frame - Frame manager listening to this object.factory - Entity factory to materialize entities.creator - The class creating the entities in the system.public void createEntity(E entity, be.yildizgames.common.model.EntityId builderId, int index)
SimpleConstructionManagercreateEntity in interface SimpleConstructionManager<T extends be.yildizgames.engine.feature.entity.Entity>entity - Entity to build state.builderId - Unique id of the builder.index - Unique index for this construction.public void createEntity(be.yildizgames.engine.feature.entity.EntityToCreate entity)
createEntity in interface CompleteConstructionManager<T extends be.yildizgames.engine.feature.entity.Entity>public void cancel(WaitingEntity w)
CompleteConstructionManagercancel in interface CompleteConstructionManager<T extends be.yildizgames.engine.feature.entity.Entity>w - Entity to cancel.public boolean frameEnded(long time)
frameEnded in class be.yildizgames.common.frame.FrameListenertime - Time since the last call.public void willNotify(ConstructionListener... listeners)
SimpleConstructionManagerwillNotify in interface SimpleConstructionManager<T extends be.yildizgames.engine.feature.entity.Entity>listeners - Listeners to notify.public void removeListener(ConstructionListener listener)
listener - Listener to remove.public List<WaitingEntity> getEntityToBuildList()
getEntityToBuildList in interface CompleteConstructionManager<T extends be.yildizgames.engine.feature.entity.Entity>public List<WaitingEntity> getEntityToBuildList(be.yildizgames.common.model.PlayerId player)
getEntityToBuildList in interface CompleteConstructionManager<T extends be.yildizgames.engine.feature.entity.Entity>player - Id of the owner.Copyright © 2017–2018. All rights reserved.