|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.SecurePlay.SPRootTransactionClass
com.SecurePlay.SPAbstractTransactionClass
com.SecurePlay.SPTRandom.SPTRandomClass
This transaction class extends the SPAbstractTransaction class. It provides for the generation of fair random events over a network based on a Random. The APIconfigureTransaction method sets the 3 unique parameters - deckSize, repacement, and expirecount for the Random. The Random class can be used for a typical game with a shared Random and a dealer or for games without shared Randoms (in which case each Random is a separate instance of the class). Randoms can contain multiple "decks", but this is handled at the game rules level outside of the SecurePlay library
![]() |
![]() |
![]() |
![]() |
| Field Summary |
| Fields inherited from class com.SecurePlay.SPAbstractTransactionClass |
classAPI, configuration, gameblock, gameinstance, transactionstatus, transtype |
| Fields inherited from class com.SecurePlay.SPRootTransactionClass |
EventListenerList, gameID, master, playerIDList, transactionID |
| Constructor Summary | |
SPTRandomClass(SPGameInterface gameobj,
java.lang.String master,
java.lang.String[] playerIDList,
boolean privateflag,
java.lang.String transactionID)
Overloaded Constructor |
|
| Method Summary | |
static boolean |
APIBcreateTransaction(SPGameAPIClass gapi,
java.lang.String transmaster,
java.lang.String[] playerIDList,
boolean privateflag)
This method allows the creation of a new Random type, internally controlled transaction. |
boolean |
APIbeginTransaction(java.lang.String pid)
This action can only be initiated by the Transaction master. |
boolean |
APIcompleteTransaction(java.lang.String pid)
This method overrides the SPAbstractTransactionClass method. |
boolean |
APIconfigureTransaction(java.lang.String sender,
int decksize,
boolean replacement,
int expiration)
This method handles the specific configuration required for a Random |
boolean |
APIconfigureTransaction(java.lang.String sender,
java.lang.String[] args)
This method overrides the APIconfigureTransaction included in the SPAbstractTransactionClass. |
static SPTRandomClass |
APIcreateTransaction(SPGameAPIClass gapi,
java.lang.String transmaster,
java.lang.String[] playerIDList,
boolean privateflag)
This method allows the creation of a new Random type, internally controlled transaction. |
boolean |
APIgenerateRandomEvent(java.lang.String sender,
java.lang.String[] receivers,
boolean privacy,
int count)
This method handles either requests or local generation of random events by the Random master. |
java.lang.String[] |
APIgetlastRandomEvents()
This method returns an array that includes the last set of random events provided by the Random master. |
int |
APIgetRandomEvent(int index)
This method returns a random event from the dealtEventList property as specified by the index. |
boolean |
APIrequestbeginTransaction(java.lang.String pid)
This method allows any transaction participant excluding the Transaction master to request that the transaction be begun. |
java.lang.String |
APISPawn(java.lang.String pid)
This method creates a new transaction with the identical participants and configuration as the spawning transaction. |
static SPTRandomAPIClass |
APITAOcreateTransaction(SPGameAPIClass gapi,
java.lang.String transmaster,
java.lang.String[] playerIDList,
boolean privateflag)
This method allows the creation of a new Random type, internally controlled transaction. |
SPUEctf |
APIverifyRandom()
This method verifies a Random once the transaction has been completed. |
protected SPAbstractTransactionInterface |
buildSPawn()
This method provides the unique transaction creation services for spawned Random transactions |
SPAbstractTransactionInterface |
createTransaction(SPGameAPIInterface gameapiobj,
java.lang.String master,
java.lang.String[] playerIDList,
boolean privateflag,
java.lang.String transactionID)
This method creates a SPRandomClass transaction. |
java.lang.String[] |
getDealtEventList()
Getter function that returns the property: dealtEventList |
int |
getLastcount()
Getter function that returns the property: lastcount |
int |
getPrdeckSize()
Getter function that returns the property: prdeckSize |
int |
getPrexpireeventcount()
Getter function that returns the property: prexpireeventcount |
java.lang.Integer[] |
getPrkeyArray()
Getter function that returns the property: prkeyArray |
int |
getPrkeySize()
Getter function that returns the property: prkeySize |
SPMap |
getPrplayerKeyList()
Getter function that returns the property: prplayerKeyList |
SPMap |
getPrplayerKeyTransformList()
Getter function that returns the property: prplayerKeyTransformList |
java.lang.Integer[] |
getPrremainingValuesList()
Getter function that returns the property: prremainingValuesList |
static java.lang.String |
gettranstype()
This method gets the transaction type. |
boolean |
isBuilt()
Getter function that returns the property: built |
boolean |
isPrreplacement()
Getter function that returns the property: prreplacement |
boolean |
oncompleteTransaction(SPMessageClass incoming)
This method handles incoming "completeTransaction" messages. |
boolean |
oncompleteTransaction(java.lang.String sourceid,
java.lang.String[] body)
This method handles incoming "completeTransaction" messages. |
boolean |
onprepareRandom(SPMessageClass incoming)
This method/event handles the initial response to the APIconfigureTransaction call by the Transaction Master. |
boolean |
onRandomEvents(SPMessageClass incoming)
This method handles incoming random events from the Random master. |
protected void |
onrequestconfigureTransaction(SPMessageClass incoming)
This method handles the unique processing associated with incoming requests to configure a Random Class. |
boolean |
onrequestRandomEvents(SPMessageClass incoming)
This method handles incoming requests to generate Random events. |
boolean |
onsendPlayerKey(SPMessageClass incoming)
This method handles incoming "sendPlayerKey" messages. |
boolean |
onsendPlayerKeyTransform(SPMessageClass incoming)
This method handles incoming "sendPlayerKeyTransform" messages. |
protected boolean |
onSpawn(SPMessageClass incoming)
This method handles incoming spawn messages. |
boolean |
prbuildRandom()
This method provides the core configuration common to all Randoms. |
void |
prcreateRandomKey()
This method actually builds the game key from the various player keys. |
boolean |
prgetRandomValue(java.lang.String playverifyflag)
This method actually generates the random values. |
boolean |
pronincomingTransaction(SPMessageClass incoming)
This method provides the unique handlers for incoming Secret turn message types |
void |
pruniqueinit()
Unique initialization method |
static boolean |
registerTransaction()
Registers this transaction. |
boolean |
spawnConfigureRandom(SPTRandomClass a)
This method provides the unique transaction configuration services for spawned Random transactions |
SPTRandomAPIClass |
SPgetAPI()
Gets this class's API |
| Methods inherited from class com.SecurePlay.SPRootTransactionClass |
APIAddListener, APIClearListeners, APIGetListenerCount, APIGetListeners, APIRemoveListener, getGameID, getMaster, getPlayerIDList, getTransactionID, isPlayerIncluded, SPnotify |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.SecurePlay.SPAbstractTransactionInterface |
getGameID, getMaster, getPlayerIDList, getTransactionID |
| Constructor Detail |
public SPTRandomClass(SPGameInterface gameobj,
java.lang.String master,
java.lang.String[] playerIDList,
boolean privateflag,
java.lang.String transactionID)
gameobj - SPGameInterface - the game object with which the transaction will be associatedmaster - String - the master of the transactionplayerIDList - String[] - the player id listprivateflag - boolean - private flagtransactionID - String - the transaction id| Method Detail |
public void pruniqueinit()
pruniqueinit in class SPAbstractTransactionClass
public boolean APIconfigureTransaction(java.lang.String sender,
java.lang.String[] args)
APIconfigureTransaction in class SPAbstractTransactionClasssender - String - the senderargs - String[] - the configuration array
public boolean APIconfigureTransaction(java.lang.String sender,
int decksize,
boolean replacement,
int expiration)
sender - String - player id of the senderdecksize - int - deck size of the Random transactionreplacement - boolean - flag for replacability of the deck of this Random transactionexpiration - int - number of transactions before stop.
public boolean onprepareRandom(SPMessageClass incoming)
incoming - SPMessageClass - incoming message
public boolean onsendPlayerKeyTransform(SPMessageClass incoming)
incoming - SPMessageClass - incoming message
public boolean onsendPlayerKey(SPMessageClass incoming)
incoming - SPMessageClass - incoming message
public boolean prbuildRandom()
public void prcreateRandomKey()
public boolean APIgenerateRandomEvent(java.lang.String sender,
java.lang.String[] receivers,
boolean privacy,
int count)
sender - String - senderreceivers - String - player id list of the recieversprivacy - boolean - privacy policycount - int - the number of random events to be generated
public boolean prgetRandomValue(java.lang.String playverifyflag)
playverifyflag - String
public boolean onrequestRandomEvents(SPMessageClass incoming)
incoming - SPMessageClass - incoming message
public boolean onRandomEvents(SPMessageClass incoming)
incoming - SPMessageClass - incoming message
public int APIgetRandomEvent(int index)
index - int - the specifier of the random event
public java.lang.String[] APIgetlastRandomEvents()
public boolean APIcompleteTransaction(java.lang.String pid)
APIcompleteTransaction in class SPAbstractTransactionClasspid - String - ID of requesting Player
public boolean oncompleteTransaction(java.lang.String sourceid,
java.lang.String[] body)
sourceid - String - id of the sender.body - String[] - the mody of the message.
public SPUEctf APIverifyRandom()
public boolean pronincomingTransaction(SPMessageClass incoming)
pronincomingTransaction in class SPAbstractTransactionClassincoming - SPMessageClass - incoming message
protected void onrequestconfigureTransaction(SPMessageClass incoming)
onrequestconfigureTransaction in class SPAbstractTransactionClassincoming - SPMessageClass - incoming messagepublic java.lang.String APISPawn(java.lang.String pid)
APISPawn in class SPAbstractTransactionClasspid - String - player id must be master of the transaction
protected SPAbstractTransactionInterface buildSPawn()
buildSPawn in class SPAbstractTransactionClasspublic boolean spawnConfigureRandom(SPTRandomClass a)
protected boolean onSpawn(SPMessageClass incoming)
onSpawn in class SPAbstractTransactionClassincoming - SPMessageClass - message
public boolean APIbeginTransaction(java.lang.String pid)
APIbeginTransaction in class SPAbstractTransactionClasspid - String - id of the transaction beginner, must be the master and internal.
public boolean APIrequestbeginTransaction(java.lang.String pid)
APIrequestbeginTransaction in class SPAbstractTransactionClasspid - String - the id of the requestor, can not be master, must be internal
public SPTRandomAPIClass SPgetAPI()
public boolean oncompleteTransaction(SPMessageClass incoming)
incoming - SPMessageClass - incoming message
public boolean isBuilt()
public java.lang.String[] getDealtEventList()
public int getLastcount()
public int getPrdeckSize()
public int getPrexpireeventcount()
public java.lang.Integer[] getPrkeyArray()
public int getPrkeySize()
public SPMap getPrplayerKeyList()
public SPMap getPrplayerKeyTransformList()
public java.lang.Integer[] getPrremainingValuesList()
public boolean isPrreplacement()
public static SPTRandomClass APIcreateTransaction(SPGameAPIClass gapi,
java.lang.String transmaster,
java.lang.String[] playerIDList,
boolean privateflag)
gapi - SPGameAPIInterface - the game that will be associated with this transaction.transmaster - String - player id of the master of the transactionplayerIDList - String[] - This is an array that holds the Player IDs of the players within the game that are participating in this transaction.privateflag - boolean - This is a flag to describe whether the specific transaction is a private transaction to the non-participating Players.
public static boolean APIBcreateTransaction(SPGameAPIClass gapi,
java.lang.String transmaster,
java.lang.String[] playerIDList,
boolean privateflag)
gapi - SPGameAPIInterface - the game that will be associated with this transaction.transmaster - String - player id of the master of the transactionplayerIDList - String[] - This is an array that holds the Player IDs of the players within the game that are participating in this transaction.privateflag - boolean - This is a flag to describe whether the specific transaction is a private transaction to the non-participating Players.
public static SPTRandomAPIClass APITAOcreateTransaction(SPGameAPIClass gapi,
java.lang.String transmaster,
java.lang.String[] playerIDList,
boolean privateflag)
gapi - SPGameAPIInterface - the game that will be associated with this transaction.transmaster - String - player id of the master of the transactionplayerIDList - String[] - This is an array that holds the Player IDs of the players within the game that are participating in this transaction.privateflag - boolean - This is a flag to describe whether the specific transaction is a private transaction to the non-participating Players.
public static java.lang.String gettranstype()
public static boolean registerTransaction()
public SPAbstractTransactionInterface createTransaction(SPGameAPIInterface gameapiobj,
java.lang.String master,
java.lang.String[] playerIDList,
boolean privateflag,
java.lang.String transactionID)
createTransaction in interface SPAbstractTransactionInterfacecreateTransaction in class SPAbstractTransactionClassgameapiobj - SPGameAPIInterface - the game that will be associated with this transaction.master - String - player id of the master of the transactionplayerIDList - String[] - This is an array that holds the Player IDs of the players within the game that are participating in this transaction.privateflag - boolean - This is a flag to describe whether the specific transaction is a private transaction to the non-participating Players.transactionID - String - transaction id.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||