From 3df6b5381ff05f9afb1b8c5f39d96aad95956ad2 Mon Sep 17 00:00:00 2001 From: Morgan - 6 Freedom Date: Sun, 28 Jan 2024 12:14:09 +0100 Subject: [PATCH] room has current question id as string --- Assets/Scripts/DatabaseClasses/Room.cs | 4 ++-- Assets/Scripts/GameManager.cs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/DatabaseClasses/Room.cs b/Assets/Scripts/DatabaseClasses/Room.cs index 772cab7..3babba1 100644 --- a/Assets/Scripts/DatabaseClasses/Room.cs +++ b/Assets/Scripts/DatabaseClasses/Room.cs @@ -10,7 +10,7 @@ public class Room public string code; public Dictionary questions; public Dictionary players; - public int currentQuestion; + public string currentQuestionId; public double creationDate; public int currentState; @@ -20,7 +20,7 @@ public Room(string _code) creationDate = DateTime.Now.ToOADate(); players = new Dictionary(); questions = new Dictionary(); - currentQuestion = 0; + currentQuestionId = ""; currentState = 1; //default by PC } diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 09831c7..e483b84 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -321,10 +321,10 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs e) } case (int)GameState.WaitingForOtherPlayersToJoin: { - + CheckIfIAmTheFirst(myRoom.GetPlayerList()); UpdateDisplayedListUser(myRoom.GetPlayerList()); - + break; } case (int)GameState.Explanation: @@ -407,8 +407,8 @@ public void OnClickSubmitSignIn() public void onClickSamePlayers() { myRoom.currentState = (int)GameState.Explanation; - myRoom.currentQuestion = 2; myRoom.questions = null; + myRoom.currentQuestionId = string.Empty; string json = JsonUtility.ToJson(myRoom); myOnlineRoom.SetRawJsonValueAsync(json).ContinueWithOnMainThread(task => @@ -423,7 +423,7 @@ public void onClickSamePlayers() public void onClickNewPlayers() { myRoom.currentState = (int)GameState.EnteringName; - myRoom.currentQuestion = 0; + myRoom.currentQuestionId = string.Empty; myRoom.questions = null; myRoom.players = null; string json = JsonUtility.ToJson(myRoom);