public class Invitation extends Object implements ParlorCodes, ParlorService.InviteListener
| Modifier and Type | Field and Description |
|---|---|
GameConfig |
config
The configuration of the game to be created.
|
int |
inviteId
The unique id for this invitation (as assigned by the
server).
|
com.threerings.util.Name |
opponent
The name of the other user involved in this invitation.
|
ALREADY_AT_TABLE, BANNED_FROM_TABLE, GAME_ALREADY_STARTED, INVALID_TABLE_POSITION, INVITATION_ACCEPTED, INVITATION_COUNTERED, INVITATION_REFUSED, INVITEE_NOT_ONLINE, MUST_BE_CREATOR, NO_SELF_BOOT, NO_SUCH_TABLE, NOT_AT_TABLE, PARLOR_GROUP, TABLE_POSITION_OCCUPIED| Constructor and Description |
|---|
Invitation(ParlorContext ctx,
ParlorService pservice,
com.threerings.util.Name opponent,
GameConfig config,
InvitationResponseObserver observer)
Constructs a new invitation record.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept()
Accepts this invitation.
|
void |
cancel()
Cancels this invitation.
|
void |
counter(GameConfig config,
InvitationResponseObserver observer)
Counters this invitation with an invitation with different game
configuration parameters.
|
void |
inviteReceived(int inviteId)
Called in response to a successful
ParlorService.invite(com.threerings.util.Name, com.threerings.parlor.game.data.GameConfig, com.threerings.parlor.client.ParlorService.InviteListener) request. |
void |
refuse(String message)
Refuses this invitation.
|
void |
requestFailed(String reason) |
String |
toString() |
public int inviteId
public com.threerings.util.Name opponent
public GameConfig config
public Invitation(ParlorContext ctx, ParlorService pservice, com.threerings.util.Name opponent, GameConfig config, InvitationResponseObserver observer)
public void accept()
public void refuse(String message)
message - the message to deliver to the inviting user
explaining the reason for the refusal or null if no message is to
be provided.public void cancel()
public void counter(GameConfig config, InvitationResponseObserver observer)
config - the updated game configuration.observer - the entity that will be notified if this
counter-invitation is accepted, refused or countered.public void inviteReceived(int inviteId)
ParlorService.InviteListenerParlorService.invite(com.threerings.util.Name, com.threerings.parlor.game.data.GameConfig, com.threerings.parlor.client.ParlorService.InviteListener) request.inviteReceived in interface ParlorService.InviteListenerpublic void requestFailed(String reason)
requestFailed in interface com.threerings.presents.client.InvocationService.InvocationListenerCopyright © 2015. All rights reserved.