Class DefaultEntityManager
java.lang.Object
games.stendhal.server.core.rule.defaultruleset.DefaultEntityManager
- All Implemented Interfaces:
EntityManager
entity manager for the default ruleset.
- Author:
- Matthias Totz
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddCreature(DefaultCreature creature) booleanaddItem(DefaultItem item) booleanaddSpell(DefaultSpell spell) getCreature(String clazz) returns the creature ornullif the clazz is unknown.getCreature(String tileset, int id) returns the creature ornullif the id is unknown.getDefaultCreature(String clazz) Returns the DefaultCreature ornullif the clazz is unknown.gets a list of all configured creaturesgets a list of all configured itemsreturns the entity ornullif the id is unknown.Returns the item ornullif the clazz is unknown.getItems()Retrieves a Spell or null if the spell is unknown.booleanisCreature(String clazz) Return true if the Entity is a creature.booleanisCreature(String tileset, int id) Return true if the Entity is a creature.booleanReturn true if the Entity is a Item.booleanchecks if spellName points to an existing spellvoidFor manually populating the creature list.
-
Constructor Details
-
DefaultEntityManager
public DefaultEntityManager()no public constructor.
-
-
Method Details
-
addItem
- Specified by:
addItemin interfaceEntityManager
-
addCreature
- Specified by:
addCreaturein interfaceEntityManager
-
populateCreatureList
public void populateCreatureList()For manually populating the creature list. Useful for tests.- Specified by:
populateCreatureListin interfaceEntityManager
-
addSpell
- Specified by:
addSpellin interfaceEntityManager
-
getCreatures
- Specified by:
getCreaturesin interfaceEntityManager- Returns:
- a list of all Creatures that are instantiated.
-
getItems
- Specified by:
getItemsin interfaceEntityManager- Returns:
- a list of all Items that are instantiated.
-
getEntity
returns the entity ornullif the id is unknown.- Specified by:
getEntityin interfaceEntityManager- Parameters:
clazz- RPClass- Returns:
- the new created entity or null if class not found
- Throws:
NullPointerException- if clazz isnull
-
getCreature
Description copied from interface:EntityManagerreturns the creature ornullif the id is unknown.- Specified by:
getCreaturein interfaceEntityManager- Parameters:
tileset-id-- Returns:
- the creature or
nullif the id is unknown.
-
getCreature
Description copied from interface:EntityManagerreturns the creature ornullif the clazz is unknown.- Specified by:
getCreaturein interfaceEntityManager- Parameters:
clazz-- Returns:
- the creature or
nullif the clazz is unknown. - Throws:
NullPointerException- if clazz isnull
-
getDefaultCreature
Description copied from interface:EntityManagerReturns the DefaultCreature ornullif the clazz is unknown.- Specified by:
getDefaultCreaturein interfaceEntityManager- Parameters:
clazz-- Returns:
- the DefaultCreature or
nullif the clazz is unknown. - Throws:
NullPointerException- if clazz isnull
-
isCreature
Description copied from interface:EntityManagerReturn true if the Entity is a creature.- Specified by:
isCreaturein interfaceEntityManager- Parameters:
tileset-id-- Returns:
- true if the Entity is a creature.
-
isCreature
Description copied from interface:EntityManagerReturn true if the Entity is a creature.- Specified by:
isCreaturein interfaceEntityManager- Parameters:
clazz-- Returns:
- true if the Entity is a creature .
-
isItem
Description copied from interface:EntityManagerReturn true if the Entity is a Item.- Specified by:
isItemin interfaceEntityManager- Parameters:
clazz-- Returns:
- true if the Entity is a creature.
-
getItem
Description copied from interface:EntityManagerReturns the item ornullif the clazz is unknown.- Specified by:
getItemin interfaceEntityManager- Parameters:
clazz-- Returns:
- the item or
nullif the clazz is unknown. - Throws:
NullPointerException- if clazz isnull
-
getSpell
Description copied from interface:EntityManagerRetrieves a Spell or null if the spell is unknown.- Specified by:
getSpellin interfaceEntityManager- Returns:
- the spell or null if spell is unknown
-
isSpell
Description copied from interface:EntityManagerchecks if spellName points to an existing spell- Specified by:
isSpellin interfaceEntityManager- Returns:
- true iff a spell with that name exists
-
getSpells
- Specified by:
getSpellsin interfaceEntityManager- Returns:
- a collection of spells that are used at least once
-
getDefaultCreatures
Description copied from interface:EntityManagergets a list of all configured creatures- Specified by:
getDefaultCreaturesin interfaceEntityManager- Returns:
- list of default creatures
-
getDefaultItems
Description copied from interface:EntityManagergets a list of all configured items- Specified by:
getDefaultItemsin interfaceEntityManager- Returns:
- list of default items
-
getConfiguredItems
-
getConfiguredSpells
- Specified by:
getConfiguredSpellsin interfaceEntityManager- Returns:
- a collection of all available spells
-