/// <summary> /// Method for performing all neccessary operations to run update methods. /// </summary> /// /// <param name="dm"> Specifies the domain model used for the following registration. </param> public void registerNewPlayer(DomainModel dm) { gameSituationStructure = null; currentGameSituation = null; gameSituationHistory = new Dictionary <string, int>(); GameSituationStructure gss = new GameSituationStructure(dm); setGameSituationStructure(gss); setCurrentGameSituation(gss.InitialGameSituation); }
/// <summary> /// Returns the Id of the next game situation. /// </summary> /// /// /// <returns> Identification of the next game situation proposed for the player. </returns> public String getNextGameSituationId( ) { if (gameSituationStructure == null) { loggingPRA("The game situation structure for the player does not exist."); return(null); } GameSituationStructure gss = gameSituationStructure; GameSituation nextGS = gss.determineNextGameSituation(); if (nextGS != null) { updateGameSituationHistory(nextGS); return(nextGS.Id); } return(null); }
/// <summary> /// Sets a game situation structure to a player. /// </summary> /// /// <param name="gss"> Game situation structure which gets linked to the player id. </param> internal void setGameSituationStructure(GameSituationStructure gss) { gameSituationStructure = gss; }