|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectbe.saltwater.jaqel.scheduler.CreatureActionScheduler
Every Level has one CreatureActionScheduler. It takes care of approving and executing all actions (CreatureAction) that are passed to it. Actions consist of animations that are implemented by ScheduledBehavior objects. These are Java3D behaviors that can call back to the scheduler when they are finished. An action is concidered finished if all animations are finished or if the action is force-finished with finishAction(). When the action has finished, the next action in the queue is started in the same way. Action get in the queue by passing them to execute (if they are allowed, see CreatureAction.isAllowed()).
CreatureAction,
ScheduledBehavior,
CreatureAction.isAllowed(be.saltwater.jaqel.scheduler.CreatureActionScheduler),
execute(be.saltwater.jaqel.scheduler.CreatureAction)| Field Summary | |
static javax.media.j3d.Bounds |
BEHAVIOR_BOUNDS
|
| Constructor Summary | |
CreatureActionScheduler()
Only a Level should construct a new CreatureActionScheduler |
|
| Method Summary | |
int |
attack(Weapon weapon,
Creature attacking_creature,
Creature attacked_creature,
int times)
Convenience method for creating a new AttackAction and passing it to execute(). |
int |
drink(Potion potion,
Creature creature)
Convenience method for creating a new DrinkAction and passing it to execute(). |
int |
execute(CreatureAction action)
When the action is allowed, the given action is executed either direct (when the queue is empty) or differed. |
protected void |
finishAction()
Should only be called by ScheduledBehavior.finishAction() and finishAnimation(). |
protected void |
finishAnimation(ScheduledBehavior animation)
Should only be called by ScheduledBehavior.finishAnimation(). |
javax.media.j3d.BranchGroup |
getBranchGroup()
Returns the BranchGroup to which all the ScheduledBehavior objects are attached (and detached). |
java.awt.Point |
getEndLocation(Creature c)
Returns the ending location of the given creature. |
int |
getQueueSize()
|
int |
move(java.util.List path,
Creature creature)
Convenience method for creating a new MoveAction and passing it to execute(). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final javax.media.j3d.Bounds BEHAVIOR_BOUNDS
| Constructor Detail |
public CreatureActionScheduler()
| Method Detail |
public int execute(CreatureAction action)
action - The action to be executedCreatureAction.isAllowed(be.saltwater.jaqel.scheduler.CreatureActionScheduler)
public int move(java.util.List path,
Creature creature)
execute(be.saltwater.jaqel.scheduler.CreatureAction),
MoveAction
public int attack(Weapon weapon,
Creature attacking_creature,
Creature attacked_creature,
int times)
execute(be.saltwater.jaqel.scheduler.CreatureAction),
AttackAction
public int drink(Potion potion,
Creature creature)
execute(be.saltwater.jaqel.scheduler.CreatureAction),
DrinkActionpublic javax.media.j3d.BranchGroup getBranchGroup()
protected void finishAnimation(ScheduledBehavior animation)
protected void finishAction()
public int getQueueSize()
public java.awt.Point getEndLocation(Creature c)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||