public final class ConstructionQueue<R extends be.yildizgames.engine.feature.entity.construction.EntityConstructionStatus> extends Object
| Constructor | Description |
|---|---|
ConstructionQueue(be.yildizgames.common.model.EntityId builderId,
int maxSize) |
Create a new instance.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
add(R e) |
Add a new entity to build in the queue.
|
be.yildizgames.common.model.EntityId |
getBuilderId() |
|
List<R> |
getList() |
|
int |
getNumberOfEntities(be.yildizgames.engine.feature.entity.data.EntityType type) |
Compute the number of entities for a given type.
|
boolean |
hasOnlyOneElement() |
|
boolean |
isEmpty() |
|
boolean |
remove(int request) |
|
void |
set(List<R> list) |
Reset the construction list with new values.
|
public ConstructionQueue(be.yildizgames.common.model.EntityId builderId,
int maxSize)
builderId - Id of the builder holding this queue.maxSize - Maximum size for the queue.NullPointerException - If builderId is null.public void add(R e)
e - Entity data.public boolean isEmpty()
public void set(List<R> list)
list - New values to set in the list.ConstructionQueueFullException - If the list size is bigger than the max size.public boolean remove(int request)
public int getNumberOfEntities(be.yildizgames.engine.feature.entity.data.EntityType type)
type - Type to check.public boolean hasOnlyOneElement()
public be.yildizgames.common.model.EntityId getBuilderId()
Copyright © 2017–2018. All rights reserved.