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
-
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 id 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
For manually populating the creature list.
-
Constructor Details
-
DefaultEntityManager
public DefaultEntityManager()no public constructor.
-
-
Method Details
-
addItem
- Specified by:
addItem
in interfaceEntityManager
-
addCreature
- Specified by:
addCreature
in interfaceEntityManager
-
populateCreatureList
public void populateCreatureList()For manually populating the creature list. Useful for tests.- Specified by:
populateCreatureList
in interfaceEntityManager
-
addSpell
- Specified by:
addSpell
in interfaceEntityManager
-
getCreatures
- Specified by:
getCreatures
in interfaceEntityManager
- Returns:
- a list of all Creatures that are instantiated.
-
getItems
- Specified by:
getItems
in interfaceEntityManager
- Returns:
- a list of all Items that are instantiated.
-
getEntity
returns the entity ornull
if the id is unknown.- Specified by:
getEntity
in 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:EntityManager
returns the creature ornull
if the id is unknown.- Specified by:
getCreature
in interfaceEntityManager
- Parameters:
tileset
-id
-- Returns:
- the creature or
null
if the id is unknown.
-
getCreature
Description copied from interface:EntityManager
returns the creature ornull
if the clazz is unknown.- Specified by:
getCreature
in interfaceEntityManager
- Parameters:
clazz
-- Returns:
- the creature or
null
if the clazz is unknown. - Throws:
NullPointerException
- if clazz isnull
-
getDefaultCreature
Description copied from interface:EntityManager
Returns the DefaultCreature ornull
if the clazz is unknown.- Specified by:
getDefaultCreature
in interfaceEntityManager
- Parameters:
clazz
-- Returns:
- the DefaultCreature or
null
if the clazz is unknown. - Throws:
NullPointerException
- if clazz isnull
-
isCreature
Description copied from interface:EntityManager
Return true if the Entity is a creature.- Specified by:
isCreature
in interfaceEntityManager
- Parameters:
tileset
-id
-- Returns:
- true if the Entity is a creature.
-
isCreature
Description copied from interface:EntityManager
Return true if the Entity is a creature.- Specified by:
isCreature
in interfaceEntityManager
- Parameters:
clazz
-- Returns:
- true if the Entity is a creature .
-
isItem
Description copied from interface:EntityManager
Return true if the Entity is a Item.- Specified by:
isItem
in interfaceEntityManager
- Parameters:
clazz
-- Returns:
- true if the Entity is a creature.
-
getItem
Description copied from interface:EntityManager
Returns the item ornull
if the clazz is unknown.- Specified by:
getItem
in interfaceEntityManager
- Parameters:
clazz
-- Returns:
- the item or
null
if the clazz is unknown. - Throws:
NullPointerException
- if clazz isnull
-
getSpell
Description copied from interface:EntityManager
Retrieves a Spell or null if the spell is unknown.- Specified by:
getSpell
in interfaceEntityManager
- Returns:
- the spell or null if spell is unknown
-
isSpell
Description copied from interface:EntityManager
checks if spellName points to an existing spell- Specified by:
isSpell
in interfaceEntityManager
- Returns:
- true iff a spell with that name exists
-
getSpells
- Specified by:
getSpells
in interfaceEntityManager
- Returns:
- a collection of spells that are used at least once
-
getDefaultCreatures
Description copied from interface:EntityManager
gets a list of all configured creatures- Specified by:
getDefaultCreatures
in interfaceEntityManager
- Returns:
- list of default creatures
-
getDefaultItems
Description copied from interface:EntityManager
gets a list of all configured items- Specified by:
getDefaultItems
in interfaceEntityManager
- Returns:
- list of default items
-
getConfiguredItems
-
getConfiguredSpells
- Specified by:
getConfiguredSpells
in interfaceEntityManager
- Returns:
- a collection of all available spells
-