Class PlayerResponse

java.lang.Object
edu.wisc.game.rest.ResponseBase
edu.wisc.game.rest.PlayerResponse

public class PlayerResponse extends ResponseBase
The object returned by the /player call. This is the call that's used at the beginning (or resumption) of a series, to create a new player entry in the database or find an existing one.
  • Method Details

    • getNewlyRegistered

      public boolean getNewlyRegistered()
    • getTrialListId

      public String getTrialListId()
    • getTrialList

      public TrialList getTrialList()
    • getPlayerId

      public String getPlayerId()
    • setPlayerId

      public void setPlayerId(String _playerId)
    • getPlayerInfo

      public PlayerInfo getPlayerInfo()
    • getAlreadyFinished

      public boolean getAlreadyFinished()
      True if this player has finished all episodes he could play. This means that the most recent episode has been completed, and no more new episodes can be created.
    • getCompletionCode

      public String getCompletionCode()
    • getExperimentPlan

      public String getExperimentPlan()
    • getIsCoopGame

      public boolean getIsCoopGame()
      Are we playing a cooperative two-player game (2PG)?
    • getIsAdveGame

      public boolean getIsAdveGame()
      Are we playing an adversarial 2PG?
    • getIsTwoPlayerGame

      public boolean getIsTwoPlayerGame()
      Are we playing a 2PG? (A 2PG may be adversarial or cooperative)
    • getNeedChat

      public boolean getNeedChat()
      Do we need a between-player chat element in the GUI? (In 2PG only, based on para.chat
    • findPlayerInfo

      public static PlayerInfo findPlayerInfo(javax.persistence.EntityManager em, String pid) throws IOException, IllegalInputException, ReflectiveOperationException, RuleParseException
      Find the matching record for a player, in the cache of the database. First looks it up in the local cache; then, if not found, in the SQL database. The main block is synchronized, to ensure that we don't put duplicate copies of a database entry into the cache.
      Parameters:
      em - The EntityManager to use, if needed. If null is given, the EM will be created when needed, and then closed, so that the returned object will be detached.
      Returns:
      The PlayerInfo object with the matching name, or null if none is found
      Throws:
      IOException
      IllegalInputException
      ReflectiveOperationException
      RuleParseException
    • main

      public static void main(String[] argv) throws Exception
      Handy testing
      Throws:
      Exception