public class Mediator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
gameInProgress |
(package private) GameSpec |
spec |
(package private) GameBridgeUtils |
utils |
Constructor and Description |
---|
Mediator(GameBridgeUtils u)
The constructor for the Mediator.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
addToAgent(Event e)
Adds an event to the queue to be sent to the corresponding agent.
|
(package private) void |
clearAgentQueue()
Used when an Event comes in that signals the end of the game.
|
(package private) boolean |
isActivePage()
Returns whether or not the Mediator has received a signal from the webpage recently.
|
(package private) boolean |
isPageOpen()
Returns whether or not the webpage is open.
|
(package private) void |
makeRunnable()
A method to be called by GBU to indicate that the Mediator's VHRunner can run.
|
boolean |
pendingAgentEvent()
Called by the associated VHRunner to determine whether or not this Mediator holds an Event for it to look at.
|
(package private) void |
setActivePage(boolean activePage)
A method to toggle the activePage field of this object.
|
(package private) void |
setGameSpec(GameSpec newSpec)
Changes the GameSpec of the Mediator.
|
(package private) void |
stopRunning()
A method to be called by GBU or the Mediator's VHRunner to indicate that the VHRunner should stop running.
|
(package private) Event |
takeForAgent()
Takes an Event from the queue so that the VHRunner can use the Event.
|
boolean gameInProgress
GameSpec spec
GameBridgeUtils utils
Mediator(GameBridgeUtils u)
u
- A reference to GBUvoid setGameSpec(GameSpec newSpec)
newSpec
- the new GameSpec to be used.void addToAgent(Event e)
e
- the event to be sent to the agent associated with this Mediator.Event takeForAgent()
void clearAgentQueue()
public boolean pendingAgentEvent()
void makeRunnable()
void stopRunning()
boolean isPageOpen()
boolean isActivePage()
void setActivePage(boolean activePage)
activePage
- true when called from this and/or GBU, false when called from VHRunner.