Compare commits

..

No commits in common. "686b00b8d54d6e12f4cb0f8b5637697b3c91bf40" and "e41f0d83d5cc74f83a176f76a9fa13dcc8cccf66" have entirely different histories.

View File

@ -115,19 +115,6 @@ private void Update()
} }
} }
if (myRoom.currentState == (int)GameState.MakeVote && endOfViewDate != DateTime.MinValue)
{
TimeSpan duration = endOfViewDate - DateTime.Now;
counterMakeProposition.text = ((int)duration.TotalSeconds).ToString("D1");
if (duration.TotalMilliseconds <= 0)
{
Debug.Log("It's time to finish proposition !");
endOfViewDate = DateTime.MinValue;
}
}
} }
@ -475,7 +462,7 @@ public void onClickSamePlayers()
{ {
myRoom.currentState = (int)GameState.Explanation; myRoom.currentState = (int)GameState.Explanation;
myRoom.questions = null; myRoom.questions = null;
myRoom.currentQuestionId = 0; myRoom.currentQuestionId = string.Empty;
string json = JsonUtility.ToJson(myRoom); string json = JsonUtility.ToJson(myRoom);
myOnlineRoom.SetRawJsonValueAsync(json).ContinueWithOnMainThread(task => myOnlineRoom.SetRawJsonValueAsync(json).ContinueWithOnMainThread(task =>
@ -490,7 +477,7 @@ public void onClickSamePlayers()
public void onClickNewPlayers() public void onClickNewPlayers()
{ {
myRoom.currentState = (int)GameState.EnteringName; myRoom.currentState = (int)GameState.EnteringName;
myRoom.currentQuestionId = 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);
@ -507,7 +494,8 @@ public void onClickNewPlayers()
public void OnClickProposition(int propositionNumber) public void OnClickProposition(int propositionNumber)
{ {
List<string> voters = myRoom.questions[myRoom.currentQuestionId].propositions[propositionNumber].voters.ToList<string>(); int currentQuestionId = Int32.Parse(myRoom.currentQuestionId);
List<string> voters = myRoom.questions[currentQuestionId].propositions[propositionNumber].voters.ToList<string>();
voters.Add(currentPlayer.id); voters.Add(currentPlayer.id);
myOnlineRoom.Child("questions").Child(myRoom.currentQuestionId.ToString()).Child("propositions").Child(propositionNumber.ToString()).Child("voters").SetValueAsync(voters); myOnlineRoom.Child("questions").Child(myRoom.currentQuestionId.ToString()).Child("propositions").Child(propositionNumber.ToString()).Child("voters").SetValueAsync(voters);
} }