43 lines
918 B
C#
43 lines
918 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 = 0;
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|
|
|