|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unifreiburg.twodeedoo.model.SimpleActivity
public class SimpleActivity
Simple Composite of IActor
s.
Field Summary |
---|
Fields inherited from interface de.unifreiburg.twodeedoo.view.ISchedulable |
---|
NULL_OBJECT |
Fields inherited from interface de.unifreiburg.twodeedoo.view.IKeyHandler |
---|
NULL_OBJECT |
Constructor Summary | |
---|---|
SimpleActivity(IScene scene,
IGameController gameController)
Create instance |
Method Summary | |
---|---|
void |
addActor(IActor actor)
Add an actor, becoming its container. |
IScene |
getScene()
Getter for scene. |
void |
keyPressed(int keyCode)
Dispatch to the actor which likes that key |
void |
keyReleased(int keyCode)
Dispatch to the actor which likes that key |
boolean |
run(int elapsedTimeMillis)
Let all the contained actors run. |
void |
setScene(IScene scene)
Setter for scene. |
void |
switchToActivity(IActivity otherActivity)
Tell the IGameController that a different IActivity should be run. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleActivity(IScene scene, IGameController gameController)
scene
- the scene for new puppetsMethod Detail |
---|
public boolean run(int elapsedTimeMillis)
run
in interface ISchedulable
elapsedTimeMillis
- elapsed time since last run in ms
public void addActor(IActor actor)
addActor
in interface IActivity
actor
- an actorpublic void setScene(IScene scene)
scene
- a scene, non-null.public IScene getScene()
public void keyPressed(int keyCode)
keyPressed
in interface IKeyHandler
keyCode
- a code from KeyEvent
, e.g. KeyEvent.VK_LEFT
public void keyReleased(int keyCode)
keyReleased
in interface IKeyHandler
keyCode
- a code from KeyEvent
, e.g. KeyEvent.VK_LEFT
public void switchToActivity(IActivity otherActivity)
IGameController
that a different IActivity
should be run.
switchToActivity
in interface IActivity
otherActivity
- another IActivity.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |