Class StorableEntityList<T extends Entity>
java.lang.Object
games.stendhal.server.entity.mapstuff.office.StorableEntityList<T>
- Type Parameters:
T- type of the storable entities to be managed by this list
- All Implemented Interfaces:
TurnListener
- Direct Known Subclasses:
ArrestWarrantList,RentedSignList
a list of storable entities that can be accessed by a unique
identifier like a name.
- Author:
- hendrik
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds a storable entity.Returns the storable entity for the specified identifier.getList()gets a list of storable entities from the zone storage.protected abstract StringvoidonTurnReached(int currentTurn) This method is called when the turn number is reached.booleanremoveByName(String identifier) Removes all storable entities for this identifier.protected voidsetupTurnNotifier(int notifyDelta) protected booleanshouldExpire(T entity)
-
Constructor Details
-
StorableEntityList
-
-
Method Details
-
add
Adds a storable entity.- Parameters:
entity- storable entity- Returns:
- true in case the entity was added successfully; false in case no free spot for it was found
-
getByName
Returns the storable entity for the specified identifier.- Parameters:
identifier- name of entity- Returns:
- storable entity or
nullin case there is none
-
removeByName
Removes all storable entities for this identifier.- Parameters:
identifier- name of entity- Returns:
- if removed successfully
-
getList
gets a list of storable entities from the zone storage. Note: This is only a temporary snapshot, do not save it outside the scope of a method.- Returns:
- List of storable entities.
-
setupTurnNotifier
protected void setupTurnNotifier(int notifyDelta) -
onTurnReached
public void onTurnReached(int currentTurn) Description copied from interface:TurnListenerThis method is called when the turn number is reached.- Specified by:
onTurnReachedin interfaceTurnListener- Parameters:
currentTurn- current turn number
-
getName
-
shouldExpire
-