|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unifreiburg.twodeedoo.model.CompositeActor
public class CompositeActor
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 | |
---|---|
CompositeActor(IScene scene)
Create instance |
Method Summary | |
---|---|
void |
addActor(IActor actor)
Add an actor, becoming its container. |
IScene |
getScene()
Getter for scene. |
void |
keyPressed(int keyCode,
IGameController controller)
Dispatch to the actor which likes that key |
void |
keyReleased(int keyCode,
IGameController controller)
Dispatch to the actor which likes that key |
int |
minimalTimeSlice()
Do not call me more often than with this many ms between two runs. |
void |
removeActor(IActor actor)
Remove this actor from the actor set. |
boolean |
run(int elapsedTimeMillis,
IGameController controller)
Let all the contained actors run. |
void |
setScene(IScene scene)
Setter for scene. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CompositeActor(IScene scene)
scene
- the scene for new puppetsMethod Detail |
---|
public boolean run(int elapsedTimeMillis, IGameController controller)
run
in interface ISchedulable
elapsedTimeMillis
- elapsed time since last run in mscontroller
- to stop the game or switch activities
public void addActor(IActor actor)
Actors which are already in this activity are not added again; this call becomes a noop then.
addActor
in interface ICompositeActor
actor
- an actorpublic void removeActor(IActor actor)
(Think twice before using this method from the outside; usually, an actor should decide itself when he stops acting.)
removeActor
in interface ICompositeActor
actor
- The actor to remove. Its container will be reset iff the actor was in this activity.public void setScene(IScene scene)
scene
- a scene, non-null.public IScene getScene()
public void keyPressed(int keyCode, IGameController controller)
keyPressed
in interface IKeyHandler
keyCode
- a code from KeyEvent
, e.g. KeyEvent.VK_LEFT
controller
- TODOpublic void keyReleased(int keyCode, IGameController controller)
keyReleased
in interface IKeyHandler
keyCode
- a code from KeyEvent
, e.g. KeyEvent.VK_LEFT
controller
- TODOpublic int minimalTimeSlice()
IActivity
minimalTimeSlice
in interface IActivity
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |