Package games.stendhal.server.core.rule
Interface EntityManager
- All Known Implementing Classes:
DefaultEntityManager
public interface EntityManager
Ruleset Interface for resolving Entities in Stendhal.
- Author:
- Matthias Totz
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addCreature(DefaultCreature creature)
boolean
addItem(DefaultItem item)
boolean
addSpell(DefaultSpell spell)
getCreature(String clazz)
returns the creature ornull
if the clazz is unknown.getCreature(String tileset, int id)
returns the creature ornull
if the id is unknown.getDefaultCreature(String clazz)
Returns the DefaultCreature ornull
if the clazz is unknown.gets a list of all configured creaturesgets a list of all configured itemsReturns the entity ornull
if the class is unknown.Returns the item ornull
if the clazz is unknown.getItems()
Retrieves a Spell or null if the spell is unknown.boolean
isCreature(String clazz)
Return true if the Entity is a creature.boolean
isCreature(String tileset, int id)
Return true if the Entity is a creature.boolean
Return true if the Entity is a Item.boolean
checks if spellName points to an existing spellvoid
-
Method Details
-
addItem
-
addCreature
-
addSpell
-
getCreatures
Collection<Creature> getCreatures()- Returns:
- a list of all Creatures that are used at least once.
-
populateCreatureList
void populateCreatureList() -
getItems
Collection<Item> getItems()- Returns:
- a list of all Items that are being used at least once.
-
getDefaultCreatures
Collection<DefaultCreature> getDefaultCreatures()gets a list of all configured creatures- Returns:
- list of default creatures
-
getDefaultItems
Collection<DefaultItem> getDefaultItems()gets a list of all configured items- Returns:
- list of default items
-
getEntity
Returns the entity ornull
if the class is unknown.- Parameters:
clazz
- the creature class, must not benull
- Returns:
- the entity or
null
-
getCreature
returns the creature ornull
if the id is unknown.- Parameters:
tileset
-id
- the tile id- Returns:
- the creature or
null
-
getCreature
returns the creature ornull
if the clazz is unknown.- Parameters:
clazz
- the creature class, must not benull
- Returns:
- the creature or
null
- Throws:
NullPointerException
- if clazz isnull
-
getDefaultCreature
Returns the DefaultCreature ornull
if the clazz is unknown.- Parameters:
clazz
- the creature class- Returns:
- the creature or
null
- Throws:
NullPointerException
- if clazz isnull
-
isCreature
Return true if the Entity is a creature.- Parameters:
tileset
-id
- the tile id- Returns:
- true if it is a creature, false otherwise
-
isCreature
Return true if the Entity is a creature.- Parameters:
clazz
- the creature class, must not benull
- Returns:
- true if it is a creature, false otherwise
-
isItem
Return true if the Entity is a Item.- Parameters:
clazz
- the Item class, must not benull
- Returns:
- true if it is a Item, false otherwise
-
getItem
Returns the item ornull
if the clazz is unknown.- Parameters:
clazz
- the item class, must not benull
- Returns:
- the item or
null
-
getSpell
Retrieves a Spell or null if the spell is unknown.- Parameters:
spell
-- Returns:
- the spell or null if spell is unknown
-
isSpell
checks if spellName points to an existing spell- Parameters:
spellName
-- Returns:
- true iff a spell with that name exists
-
getSpells
Collection<Spell> getSpells()- Returns:
- a collection of spells that are used at least once
-
getConfiguredSpells
Collection<String> getConfiguredSpells()- Returns:
- a collection of all available spells
-