|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.adom.jade.kernel.Game
Stores all global data. Also all the meta data for the game is managed in this class.
Game time is measured in ticks. An average action taken by an
absolutely average person costs 1000 ticks (or energy points). The basic
assumption is that 100 ticks equal 1 second. Since the amount of ticks is
measured in a long variable, JADE is able to run for about
1.067.519.911.673 game days, which in JADE time (12 months with 28 days each)
is equal to 3.177.142.594 game years. That should be sufficient even for
those folks who tried to find the end of the infinite dungeon in ADOM.
| Method Summary | |
|---|---|
void |
addActorListener(ActorListener actorListener)
Adds an actor listener to the game. |
long |
createGUID()
Creates a new GUID. |
void |
fireAfterActionEvent(Actor actor)
Fires an actor event after an actor acts. |
void |
fireBeforeActionEvent(Actor actor)
Fires an actor event before an actor acts. |
static Game |
getInstance()
The game kernel is implemented as a singleton. |
LocationManager |
getLocationManager()
Returns the location manager for the whole world. |
PC |
getPC()
Returns the global PC instance. |
long |
getTime()
Returns the current game time. |
static UserInterface |
getUserInterface()
Returns the user interface for this game. |
int |
random(int upper)
Returns a random number in the given range of 0... |
void |
removeActorListener(ActorListener actorListener)
Removes an actor listener from the game. |
void |
setPC(PC thePC)
Sets the PC for the game. |
void |
setTime(long theTicks)
Sets the game time. |
static void |
setUserInterface(UserInterface theUI)
Sets the valid user interface for this game. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void setUserInterface(UserInterface theUI)
theUI - the user interface for this gamepublic static UserInterface getUserInterface()
public void setTime(long theTicks)
theTicks - the game time (in ticks)public long getTime()
public void setPC(PC thePC)
thePC - the PC instance to usepublic PC getPC()
public void addActorListener(ActorListener actorListener)
actorListener - the listenerpublic void removeActorListener(ActorListener actorListener)
actorListener - the listenerpublic void fireBeforeActionEvent(Actor actor)
actor - the responsible actorpublic void fireAfterActionEvent(Actor actor)
actor - the responsible actorpublic static Game getInstance()
public long createGUID()
GUIDCarrierpublic LocationManager getLocationManager()
public int random(int upper)
0...upper-1.
upper - the upper limit of the random number; a number
in the range of 0...upper-1
will be created
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||