org.gbanga.api
Class Challenge

java.lang.Object
  extended by org.gbanga.api.Event
      extended by org.gbanga.api.Challenge

public class Challenge
extends Event

A challenge is a game between two players.

Details about JSON serialization

For the JSON object serialization, the field names are used. Eg.

 {
   initiator: { name: "someplayer" },
   rounds: 7
 }
 

Fields annotated with PrimaryKey are used, if not the whole object is sent. HideIfNull indicates that the field is not sent at all, if the value is not set.

Author:
Matthias

Field Summary
 Player initiator
          The contender.
 Cell location
          The stage.
 Player opponent
          The challenged Player.
 int rounds
          The number of rounds played so far.
 int type
          The type of a Challenge Event.
 Player winner
          The winner of this challenge.
 
Fields inherited from class org.gbanga.api.Event
booleanParameters, cell, CELL_DISCOVERED, CHALLENGE, CHAT_MESSAGE_RECEIVED, CONVERSATION, CONVERSATION_MESSAGE_RECEIVED, FRIEND_BROKE, gbangoo, GBANGOO_DROPPED, GBANGOO_LIFTED, GIFT_IN_POCKET_RECEIVED, id, infrastructure, longParameters, partner, player, PLAYER_ARRIVED, PLAYER_LEFT, POCKET_ITEM_LOST, PUZZLE_COMPLETED, resource, shortParameters, SHOUT_MESSAGE_RECEIVED, stringParameters, t, tag, TAG_CODE_ENTERED, tile, TRADE, TRADE_OFFER_RECEIVED, UNKNOWN, VISIT
 
Constructor Summary
Challenge()
           
 
Method Summary
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

initiator

public Player initiator
The contender.


location

public Cell location
The stage.


opponent

public Player opponent
The challenged Player.


rounds

public int rounds
The number of rounds played so far.


type

@PrimaryKey
public int type
The type of a Challenge Event.


winner

@HideIfNull
public Player winner
The winner of this challenge. Is null if the challenge is ongoing.

Constructor Detail

Challenge

public Challenge()