|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mega.gasp.bluetooth.miniplatform.ApplicationInstance
ApplicationInstance represent a game session of a specific application. It contains a vector of ActorSession representing the actors want to play in. This classes manage the in game events.
Field Summary | |
private java.util.Vector |
actorSessions
|
private int |
applicationInstanceID
|
private java.lang.String |
applicationInstanceName
|
private CustomTypes |
customTypes
|
private IDManager |
idManager
|
private boolean |
isPublicAI
|
private boolean |
isRunningAI
|
private java.util.Vector |
listenners
|
private int |
maxA
|
private int |
minA
|
private int |
ownerActorSessionID
|
Constructor Summary | |
ApplicationInstance(int actorID,
int minActors,
int maxActors,
java.lang.String[] actors,
CustomTypes encoder)
|
Method Summary | |
int |
actorSessionSize()
Returns the current number of ActorSession objects, e.g the number of actors ready to play this game session. |
private void |
addActors(java.lang.String[] actors)
Set the pool of actors required for a private Application Instance. |
boolean |
addActorSession(ActorSession actorSession)
Add the actor to the actors vector. |
void |
addListenner(java.lang.Object listenner)
|
boolean |
containsActorSession(int actorSessionID)
Determine if the ActorSession associated with the ActorSession ID is contained by this ApplicationInstance or not. |
int |
createNewActorSession(int aIID,
int actorID)
Create a new ActorSession in the ApplicationInstance corresponding to the user actorID. |
boolean |
end(int aSID)
End the game managed by the ApplicationInstance. |
java.util.Iterator |
enumerateActorSession()
Returns an iterator on the actor sessions vector. |
ActorSession |
getActorSession(int actorSessionID)
Returns the ActorSession object corresponding to the ActorSession ID. |
int |
getApplicationInstanceID()
Returns the ID of the ApplicationInstance. |
ApplicationInstanceInfos |
getApplicationInstanceInfos()
For Lobby service, this method provide informations of the ApplicationInstance. |
java.lang.String |
getApplicationInstanceName()
Returns the name of the ApplicationInstance. |
CustomTypes |
getCustomTypes()
Returns the encoder of the application associated with the application instance. |
int |
getMaxActors()
Returns the maximum number of actors can play the game session. |
int |
getMinActors()
Returns the minimum number of actors required to start the game session. |
int |
getOwnerAID()
Returns the ActorId of the ApplicationInstanceID owner. |
boolean |
isActorSessionEmpty()
Determine if the vector of ActorSession objects is empty or not. |
boolean |
isPublic()
Determine if the ApplicationInstance is public or not. |
boolean |
isRunning()
|
private void |
notifyDataToListenners(DataEvent e)
Raise the DataEvent to all external listenners, in particular the game logic threads. |
private void |
notifyEndToListenners(EndEvent e)
Raise the EndEvent to all external listenners, in particular the game logic threads. |
private void |
notifyJoinToListenners(JoinEvent e)
Raise the JoinEvent to all external listenners, in particular the game logic threads. |
private void |
notifyQuitToListenners(QuitEvent e)
Raise the QuitEvent to all external listenners, in particular the game logic threads. |
private void |
notifyStartToListenners(StartEvent e)
Raise the StartEvent to all external listenners, in particular the game logic threads. |
private void |
notifyToAllOtherActorSession(Event e)
Put the event in event vectors of the ApplicationInstance ActorSessions. |
void |
onDataEvent(DataEvent e)
|
void |
onEndEvent(EndEvent e)
|
void |
onJoinEvent(JoinEvent e)
|
void |
onQuitEvent(QuitEvent e)
|
void |
onStartEvent(StartEvent e)
|
boolean |
removeActorSession(int actorSessionID)
Remove the ActorSession object corresponding to the ActorSessionID. |
void |
setApplicationInstanceName(java.lang.String appInstanceName)
Specify the name of the Application Instance. |
boolean |
start(int aSID)
Start the game managed by the ApplicationInstance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.util.Vector actorSessions
private int applicationInstanceID
private int ownerActorSessionID
private int minA
private int maxA
private java.lang.String applicationInstanceName
private boolean isPublicAI
private boolean isRunningAI
private java.util.Vector listenners
private CustomTypes customTypes
private IDManager idManager
Constructor Detail |
public ApplicationInstance(int actorID, int minActors, int maxActors, java.lang.String[] actors, CustomTypes encoder)
Method Detail |
public int getApplicationInstanceID()
public int getMinActors()
public int getMaxActors()
public int getOwnerAID()
public CustomTypes getCustomTypes()
public boolean isPublic()
public boolean isRunning()
public int createNewActorSession(int aIID, int actorID)
aIID
- the ApplicationInstanceactorID
- the actorID of the user
public ActorSession getActorSession(int actorSessionID)
actorSessionID
- the ActorSession ID
public boolean removeActorSession(int actorSessionID)
actorSessionID
- the ActorSesion ID
public boolean isActorSessionEmpty()
public int actorSessionSize()
public boolean containsActorSession(int actorSessionID)
actorSessionID
-
public ApplicationInstanceInfos getApplicationInstanceInfos()
public java.lang.String getApplicationInstanceName()
public java.util.Iterator enumerateActorSession()
private void addActors(java.lang.String[] actors)
actors
- the table of actorIDpublic void setApplicationInstanceName(java.lang.String appInstanceName)
appInstanceName
- public boolean addActorSession(ActorSession actorSession)
actorSession
- the ActorSession object
public boolean start(int aSID)
aSID
- the ActorSession ID
public boolean end(int aSID)
aSID
- the ActorSession ID
public void onJoinEvent(JoinEvent e)
onJoinEvent
in interface OnJoinEvent
public void onStartEvent(StartEvent e)
onStartEvent
in interface OnStartEvent
public void onEndEvent(EndEvent e)
onEndEvent
in interface OnEndEvent
public void onDataEvent(DataEvent e)
onDataEvent
in interface OnDataEvent
public void onQuitEvent(QuitEvent e)
onQuitEvent
in interface OnQuitEvent
public void addListenner(java.lang.Object listenner)
private void notifyToAllOtherActorSession(Event e)
e
- the eventprivate void notifyJoinToListenners(JoinEvent e)
e
- the JoinEventprivate void notifyEndToListenners(EndEvent e)
e
- the EndEventprivate void notifyStartToListenners(StartEvent e)
e
- the StartEventprivate void notifyQuitToListenners(QuitEvent e)
e
- the QuitEventprivate void notifyDataToListenners(DataEvent e)
e
- the DataEvent
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |