com.threerings.parlor.util
Class RobotPlayer
java.lang.Object
com.samskivert.util.Interval
com.threerings.parlor.util.RobotPlayer
public class RobotPlayer
- extends Interval
The robot player is a computer player with truly rudimentary artificial
intelligence that periodically posts random commands selected from the
available key press and release commands to the target component.
Note that Robot could have been used to post key
events to the target component rather than commands, but not all key
events can be simulated in that fashion (e.g., a right shift key
press), and this seemed somehow more proper in any case.
|
Constructor Summary |
RobotPlayer(Component target,
com.threerings.util.KeyTranslator xlate)
Constructs a robot player. |
|
Method Summary |
void |
expired()
|
boolean |
isActive()
Returns whether the robot is currently active and periodically
posting action commands. |
void |
setActive(boolean active)
Sets whether the robot player is actively posting action commands. |
void |
setRobotDelay(long delay)
Sets the delay in milliseconds between posting each action command. |
RobotPlayer
public RobotPlayer(Component target,
com.threerings.util.KeyTranslator xlate)
- Constructs a robot player.
setActive
public void setActive(boolean active)
- Sets whether the robot player is actively posting action commands.
setRobotDelay
public void setRobotDelay(long delay)
- Sets the delay in milliseconds between posting each action command.
isActive
public boolean isActive()
- Returns whether the robot is currently active and periodically
posting action commands.
expired
public void expired()
- Specified by:
expired in class Interval
Copyright © 2011. All Rights Reserved.