de.unifreiburg.twodeedoo.model
Class BaseActor

java.lang.Object
  extended by de.unifreiburg.twodeedoo.model.BaseActor
All Implemented Interfaces:
IActor, IKeyHandler, ISchedulable
Direct Known Subclasses:
LinearMotionActor

public abstract class BaseActor
extends java.lang.Object
implements IActor

Default base class for IActor implementations

Author:
anton

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
BaseActor(IScene scene)
           
 
Method Summary
 IActivity getContainer()
          Get the container
 IScene getScene()
          Get the scene.
 void keyPressed(int keyCode)
          Default action: ignore all keys
 void keyReleased(int keyCode)
          Default action: ignore all keys
 void setContainer(IActivity container)
          Change the container
 void setScene(IScene scene)
          Set the scene
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.unifreiburg.twodeedoo.view.ISchedulable
run
 

Constructor Detail

BaseActor

public BaseActor(IScene scene)
Method Detail

getContainer

public IActivity getContainer()
Get the container

Returns:
containing actor group or null

setContainer

public void setContainer(IActivity container)
Change the container

Specified by:
setContainer in interface IActor
Parameters:
container - an actor group or null.

getScene

public IScene getScene()
Get the scene.

Returns:
the scene

setScene

public void setScene(IScene scene)
Set the scene

Parameters:
scene - scene where new puppets should go

keyPressed

public void keyPressed(int keyCode)
Default action: ignore all keys

Specified by:
keyPressed in interface IKeyHandler
Parameters:
keyCode - a code from KeyEvent, e.g. KeyEvent.VK_LEFT

keyReleased

public void keyReleased(int keyCode)
Default action: ignore all keys

Specified by:
keyReleased in interface IKeyHandler
Parameters:
keyCode - a code from KeyEvent, e.g. KeyEvent.VK_LEFT