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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds a storable entity.Returns the storable entity for the specified identifier.getList()
gets a list of storable entities from the zone storage.protected abstract String
void
onTurnReached(int currentTurn)
This method is called when the turn number is reached.boolean
removeByName(String identifier)
Removes all storable entities for this identifier.protected void
setupTurnNotifier(int notifyDelta)
protected boolean
shouldExpire(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
null
in 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:TurnListener
This method is called when the turn number is reached.- Specified by:
onTurnReached
in interfaceTurnListener
- Parameters:
currentTurn
- current turn number
-
getName
-
shouldExpire
-