36 lines
772 B
C#
Raw Normal View History

2024-01-27 19:58:02 +01:00
using System;
2024-01-27 10:19:32 +01:00
using System.Collections.Generic;
2024-01-27 19:54:06 +01:00
using Newtonsoft.Json;
2024-01-27 10:19:32 +01:00
2024-01-27 19:58:02 +01:00
[Serializable]
2024-01-27 20:05:24 +01:00
[JsonObject]
2024-01-27 10:19:32 +01:00
public class Room
{
public string code;
2024-01-27 19:54:06 +01:00
public Dictionary<string, Question> questions;
public Dictionary<string, Player> players;
2024-01-27 10:19:32 +01:00
public int currentQuestion;
2024-01-27 15:08:12 +01:00
public double creationDate;
public Room(string _code)
{
2024-01-27 19:58:02 +01:00
code = _code;
creationDate = DateTime.Now.ToOADate();
players = new Dictionary<string, Player>();
questions = new Dictionary<string, Question>();
2024-01-27 19:58:02 +01:00
currentQuestion = 0;
2024-01-27 15:08:12 +01:00
}
2024-01-27 19:54:06 +01:00
public List<Player> GetPlayerList()
{
return new List<Player>(players.Values);
}
public List<Question> GetQuestionList()
{
return new List<Question>(questions.Values);
}
2024-01-27 10:19:32 +01:00
}
2024-01-27 19:54:06 +01:00