Snaparazzi/Assets/Scripts/DatabaseClasses/Room.cs
2024-01-28 00:06:23 +01:00

42 lines
933 B
C#

using System;
using System.Collections.Generic;
using Newtonsoft.Json;
[Serializable]
[JsonObject]
public class Room
{
public string code;
public Dictionary<string, Question> questions;
public Dictionary<string, Player> players;
public int currentQuestion;
public double creationDate;
public int currentState;
public Room(string _code)
{
code = _code;
creationDate = DateTime.Now.ToOADate();
players = new Dictionary<string, Player>();
questions = new Dictionary<string, Question>();
currentQuestion = 0;
currentState = 1; //default by PC
}
public List<Player> GetPlayerList()
{
return new List<Player>(players.Values);
}
public List<Question> GetQuestionList()
{
return new List<Question>(questions.Values);
}
public void setPlayersAreReady(int _state)
{
currentState = _state;
}
}