room has current question id as string

This commit is contained in:
Morgan - 6 Freedom 2024-01-28 12:14:09 +01:00
parent 146a80c4e9
commit 3df6b5381f
2 changed files with 6 additions and 6 deletions

View File

@ -10,7 +10,7 @@ public class Room
public string code; public string code;
public Dictionary<string, Question> questions; public Dictionary<string, Question> questions;
public Dictionary<string, Player> players; public Dictionary<string, Player> players;
public int currentQuestion; public string currentQuestionId;
public double creationDate; public double creationDate;
public int currentState; public int currentState;
@ -20,7 +20,7 @@ public Room(string _code)
creationDate = DateTime.Now.ToOADate(); creationDate = DateTime.Now.ToOADate();
players = new Dictionary<string, Player>(); players = new Dictionary<string, Player>();
questions = new Dictionary<string, Question>(); questions = new Dictionary<string, Question>();
currentQuestion = 0; currentQuestionId = "";
currentState = 1; //default by PC currentState = 1; //default by PC
} }

View File

@ -407,8 +407,8 @@ public void OnClickSubmitSignIn()
public void onClickSamePlayers() public void onClickSamePlayers()
{ {
myRoom.currentState = (int)GameState.Explanation; myRoom.currentState = (int)GameState.Explanation;
myRoom.currentQuestion = 2;
myRoom.questions = null; myRoom.questions = null;
myRoom.currentQuestionId = string.Empty;
string json = JsonUtility.ToJson(myRoom); string json = JsonUtility.ToJson(myRoom);
myOnlineRoom.SetRawJsonValueAsync(json).ContinueWithOnMainThread(task => myOnlineRoom.SetRawJsonValueAsync(json).ContinueWithOnMainThread(task =>
@ -423,7 +423,7 @@ public void onClickSamePlayers()
public void onClickNewPlayers() public void onClickNewPlayers()
{ {
myRoom.currentState = (int)GameState.EnteringName; myRoom.currentState = (int)GameState.EnteringName;
myRoom.currentQuestion = 0; myRoom.currentQuestionId = string.Empty;
myRoom.questions = null; myRoom.questions = null;
myRoom.players = null; myRoom.players = null;
string json = JsonUtility.ToJson(myRoom); string json = JsonUtility.ToJson(myRoom);