|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.tud.dvs1.mmpgp2p.Ruleset
public abstract class Ruleset
Für die Abarbeitung eines MmpgP2PCommand und zur Manipulation der GameWorld wird hiermit vom Endanwender eine "Spielregel"-Klasse implementiert.
| Field Summary | |
|---|---|
protected java.util.Random |
rand
|
protected long |
randSeed
|
protected long |
tickCount
|
protected long |
tickTime
|
static long |
TICKTIME
|
| Constructor Summary | |
|---|---|
protected |
Ruleset()
|
| Method Summary | |
|---|---|
abstract GameObject[] |
applyCommand(GameWorld world,
MmpgP2PCommand command)
Ein Kommando auf die Welt anwenden. |
abstract GameObject[] |
doTick(GameWorld w,
GameObject o)
Dies ist die vom Endanwender auszufüllende Methode, die regemässig ausgeführt wird. |
long |
getTickTime()
|
protected GameObject[] |
moveTo(GameWorld w,
int id,
int tox,
int toy,
int toz)
|
protected GameObject[] |
moveTo(GameWorld w,
java.lang.Object[] a)
|
double |
random()
Math.random() darf keinesfalls verwendet werden. |
void |
setTickTime(long time)
|
abstract GameObject[] |
targetReached(GameWorld w,
GameObject o)
Diese Funktion wird aufgerufen, falls ein Objekt am Ziel ankommt. |
GameObject[] |
tick(GameWorld w)
Diese Methode wird in bestimmten Zeitabständen ausgeführt und führt Berechnungen durch, die nicht aus direkten Befehlen erfolgen. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long TICKTIME
protected long tickTime
protected long tickCount
protected long randSeed
protected java.util.Random rand
| Constructor Detail |
|---|
protected Ruleset()
| Method Detail |
|---|
public abstract GameObject[] applyCommand(GameWorld world,
MmpgP2PCommand command)
throws java.lang.Exception
world - Die Welt, auf deren Objekte der Befehl angewandt wird.command - Das Kommando, welches ausgeführt werden soll.
java.lang.Exception
public abstract GameObject[] doTick(GameWorld w,
GameObject o)
throws MmpgP2PException
MmpgP2PException
public abstract GameObject[] targetReached(GameWorld w,
GameObject o)
throws MmpgP2PException
MmpgP2PExceptionpublic double random()
public GameObject[] tick(GameWorld w)
throws MmpgP2PException
MmpgP2PException
protected GameObject[] moveTo(GameWorld w,
java.lang.Object[] a)
throws MmpgP2PException
MmpgP2PException
protected GameObject[] moveTo(GameWorld w,
int id,
int tox,
int toy,
int toz)
throws MmpgP2PException
MmpgP2PExceptionpublic long getTickTime()
public void setTickTime(long time)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||