Snaparazzi/Assets/Scripts/DatabaseClasses/Room.cs

38 lines
833 B
C#

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