|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IBallEnvironment
An interface that represents the environment in which the ball is operating.
Field Summary | |
---|---|
static IBallEnvironment |
NullEnv
Represents a null environment that does nothing. |
Method Summary | |
---|---|
void |
addDisplayCmd(ILambda cmd)
Adds a command that will be run to whenever the view requests a display string to be displayed. |
void |
addKeyCmd(String keyName,
ILambda cmd)
Associates a key with a behavior (command). |
Component |
getComponent()
Gets the Component that the Balls will be painted on. |
Dispatcher |
getDispatcher()
Get the ball dispatcher used by the system. |
int |
getHeight()
Get the height of the ball's environment. |
IPlayer |
getSelectedPlayer()
Get the currently selected player. |
int |
getWidth()
Get the width of the ball's environment. |
void |
registerMovementKeys(IMovementKeys keys,
IMoveable m)
Takes an IMovementKeys object which defines a set of movement keys and associates the pressing of each key with its respective behavior in the given IMoveable object. |
Field Detail |
---|
static final IBallEnvironment NullEnv
Method Detail |
---|
Dispatcher getDispatcher()
void addKeyCmd(String keyName, ILambda cmd)
keyName
- The name of the key, as defined by the Java "virtual keys": VK_XXX (The "VK_" is omitted). See the Java documentation under "KeyEvent"cmd
- The ILambda command that will be run when the key is pressed.void addDisplayCmd(ILambda cmd)
cmd
- The command used to generate part of the total display string.Component getComponent()
int getWidth()
int getHeight()
IPlayer getSelectedPlayer()
void registerMovementKeys(IMovementKeys keys, IMoveable m)
keys
- The IMovementKeys object that defines a set of movement keys.m
- The IMoveable object that is to be associated with the key set.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |