ConstructionListener<E>public class ConstructionQueueManager<R extends be.yildizgames.engine.feature.entity.construction.EntityConstructionStatus,E extends be.yildizgames.engine.feature.entity.EntityInConstruction> extends Object implements ConstructionListener<E>
| Constructor | Description |
|---|---|
ConstructionQueueManager(BuilderManager<QueueBuilder<R>> builderManager) |
Create a new instance.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addEntity(be.yildizgames.common.model.PlayerId playerId,
be.yildizgames.common.model.EntityId builderId,
R toBuild) |
Add an entity in a list, if the list was empty, notify listener to start building.
|
void |
cancel(be.yildizgames.common.model.PlayerId playerId,
int index) |
Cancel a construction and remove it from the queue.
|
void |
entityComplete(be.yildizgames.common.model.EntityId entity,
be.yildizgames.common.model.PlayerId owner,
be.yildizgames.engine.feature.entity.data.EntityType type,
be.yildizgames.common.model.EntityId builder,
int index) |
Provide the newly created Entity and its builder Id.
|
void |
entityConstructionCanceled(WaitingEntity<E> w) |
|
void |
update(ConstructionQueue<R> items) |
Refresh a builder state with the updated queue.
|
void |
willNotify(ConstructionQueueListener listener) |
Add a new queue listener to notify.
|
addEntityToCreate, entityConstructionStartedpublic ConstructionQueueManager(BuilderManager<QueueBuilder<R>> builderManager)
builderManager - Associated builder manager.NullPointerException - If builderManager is null.public void willNotify(ConstructionQueueListener listener)
listener - Listener to add.NullPointerException - If listener is null.public void cancel(be.yildizgames.common.model.PlayerId playerId,
int index)
playerId - Player canceling the construction.index - Index of the construction.public void update(ConstructionQueue<R> items)
items - New values in the queue.NullPointerException - if items is null.public void addEntity(be.yildizgames.common.model.PlayerId playerId,
be.yildizgames.common.model.EntityId builderId,
R toBuild)
playerId - Player owner of the entity.builderId - Id of the builder of the entity.toBuild - Data of the entity to build.public void entityComplete(be.yildizgames.common.model.EntityId entity,
be.yildizgames.common.model.PlayerId owner,
be.yildizgames.engine.feature.entity.data.EntityType type,
be.yildizgames.common.model.EntityId builder,
int index)
ConstructionListenerentityComplete in interface ConstructionListener<R extends be.yildizgames.engine.feature.entity.construction.EntityConstructionStatus>entity - Id of the built entity.owner - Id of the owner of the built entity.type - Type of the built entity.builder - Id of the builder of the entity.index - An index to retrieve an entity against a request.public void entityConstructionCanceled(WaitingEntity<E> w)
entityConstructionCanceled in interface ConstructionListener<R extends be.yildizgames.engine.feature.entity.construction.EntityConstructionStatus>Copyright © 2017–2018. All rights reserved.