Package games.stendhal.server.entity.npc
Class CloneManager
java.lang.Object
games.stendhal.server.entity.npc.CloneManager
Manages registered SpeakerNPC clones.
-
Method Summary
Modifier and TypeMethodDescriptionclone(SpeakerNPC orig) Creates a new clone.clone(SpeakerNPC orig, String cloneName) Creates a new clone.Creates a new clone.Creates a new clone.static CloneManagerget()Retrieves the static instance.intgetCloneCount(String origName) Retrieves the number of currently registered clones for an NPC.static CloneManagerDeprecated.Use CloneManager.get().getOriginal(SpeakerNPC npc) Retrieves the original SpeakerNPC.getOriginal(String name) Retrieves the original SpeakerNPC.booleanisClone(SpeakerNPC npc) Checks if a SpeakerNPC is registered as a clone.booleanChecks if a name is registered as a clone.voidregisterAsClone(SpeakerNPC orig, SpeakerNPC clone) Registeres an existing SpeakerNPC as a clone of another.voidregisterAsClone(String origName, String cloneName) Registeres an existing SpeakerNPC as a clone of another.
-
Method Details
-
get
Retrieves the static instance.- Returns:
- CloneManager instance.
-
getInstance
Deprecated.Use CloneManager.get().Retrieves the static instance.- Returns:
- CloneManager instance.
-
clone
Creates a new clone.- Parameters:
orig- The SpeakerNPC to be cloned.cloneName- The hidden actual name of the entity. Ifnull, the name of the original NPC suffixed with an integer index will be used.- Returns:
- New SpeakerNPC.
-
clone
Creates a new clone.- Parameters:
orig- The SpeakerNPC to be cloned.- Returns:
- New SpeakerNPC.
-
clone
Creates a new clone.- Parameters:
name- Name of the SpeakerNPC to be cloned.cloneName- The hidden actual name of the entity. Ifnull, the name of the original NPC suffixed with an integer index will be used.- Returns:
- New SpeakerNPC.
-
clone
Creates a new clone.- Parameters:
name- Name of the SpeakerNPC to be cloned.- Returns:
- New SpeakerNPC.
-
registerAsClone
Registeres an existing SpeakerNPC as a clone of another. This only sets the "cloned" attribute for the clone entity. Any other attributes must be set manually.- Parameters:
orig- SpeakerNPC entity to be cloned.clone- SpeakerNPC entity to be registered as a clone.
-
registerAsClone
Registeres an existing SpeakerNPC as a clone of another. This only sets the "cloned" attribute for the clone entity. Any other attributes must be set manually.- Parameters:
origName- Name of the SpeakerNPC to be cloned.cloneName- Name to be registered as a clone.
-
isClone
Checks if a name is registered as a clone.- Parameters:
name- Name to be checked.- Returns:
trueif the name is found in the registered list.
-
isClone
Checks if a SpeakerNPC is registered as a clone.- Parameters:
npc- The SpeakerNPC to be checked.- Returns:
trueif the name of the SpeakerNPC is found in the registered list.
-
getOriginal
Retrieves the original SpeakerNPC.- Parameters:
name- Name of the clone.- Returns:
- The original SpeakerNPC if the clone name was found in the registered list,
otherwise
null.
-
getOriginal
Retrieves the original SpeakerNPC.- Parameters:
npc- The SpeakerNPC clone.- Returns:
- The original SpeakerNPC if the clone name was found in the registered list,
otherwise
null.
-
getCloneCount
Retrieves the number of currently registered clones for an NPC.- Parameters:
origName- Name of the original SpeakerNPC.- Returns:
- Number of registered clone names.
-