org.starhope.appius.game.npc
Class AppiusNonPlayerCharacter
java.lang.Object
org.starhope.appius.game.npc.AppiusNonPlayerCharacter
- Direct Known Subclasses:
- PythonNPCFactory
public abstract class AppiusNonPlayerCharacter
- extends Object
- Author:
- brpocock
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
AppiusNonPlayerCharacter
public AppiusNonPlayerCharacter()
getScriptedNPC
public static AbstractUser getScriptedNPC(String engine,
String script,
String klass)
throws NotFoundException,
FileNotFoundException
- This instantiates an NPC based upon a script from ... somewhere.
The script engine responsible for interpreting the script must be
specified, along with the name of the script. How the name is
interpreted varies depending on the script engine, but generally,
it's going to be an instance of a AppiusNonPlayerCharacter-
derived class object in whatever language environment that is.
- Parameters:
engine
- This the identifier for the script engine. The
supported engines are a hard-coded list in the source
code. Currently, there are plans for (but not necessarily
working support for) the following language engines: (all
of these are all-lower-case identifier strings for
uniformity): perl, lua, ruby, ecmascript, python, javascript
- This is the NPC class/script to be instantiated. In
Perl, this will be a class name of the form
Some::Class::Name. In Java, it will be something like
com.tootsville.game.items.Something. Each language has its
own conventions as to what is allowed.klass
- The class name, script name, or similar of the
desired NPC script — varies by engine.
- Returns:
- A AppiusNonPlayerCharacter instance.
- Throws:
NotFoundException
- If the script engine can't be
found/recognized/initialized
FileNotFoundException
- If the script itself can't be found- See Also:
PerlNPCFactory.getNPC(String, String)
,
LuaNPCFactory.getNPC(String, String)