Modifier and Type | Method and Description |
---|---|
boolean |
canInteract(java.lang.String player)
Tests whether a player is allowed to use the computer.
|
void |
consumeCallBudget(double callCost)
This method allows dynamic costs for direct calls.
|
boolean |
isPaused()
Whether the computer is currently in a paused state.
|
boolean |
isRunning()
Whether the computer is currently in a running state, i.e.
|
Node |
node()
The node through which the computer is attached to the component network.
|
boolean |
pause(double seconds)
Pauses the computer for the specified duration.
|
boolean |
signal(java.lang.String name,
java.lang.Object... args)
Push a signal into the computer.
|
boolean |
start()
Starts the computer.
|
boolean |
stop()
Stops the computer.
|
Node node()
boolean canInteract(java.lang.String player)
player
- the name of the player to check for.boolean isRunning()
boolean isPaused()
boolean start()
boolean pause(double seconds)
seconds
- the number of seconds to pause the computer for.boolean stop()
void consumeCallBudget(double callCost)
LimitReachedException
that should not be caught
by the callback function. It will be handled in the calling code and
take care of switching states as necessary.
Call this from a method with @Callback(direct = true)
and
no limit set to use dynamic costs. If a limit is set, it will
always be deduced from the budget in addition to this.
When called from a non-direct / synchronous callback this does nothing.callCost
- the cost of the direct call being performed.boolean signal(java.lang.String name, java.lang.Object... args)
name
- the name of the signal to push.args
- additional arguments to pass along with the signal.