public Room(int size = 4) { this.Guid = Guid.NewGuid(); this.Clients = new List <GameClient>(); this.Size = size; this.EventDespatcher = new DespawnDespatcher(this); this.Mutex = new Mutex(false, this.Guid.ToString()); }
public Game(WaitingRoom r) { this.Parent = r; this.TotalQuestion = (byte)r.Quiz.Questions.Count(); this.Questions = new Queue <Question>(); this.RewardManager = new RewardManager(); this.PlayerManager = new PlayerManager(); this.TurnTimer = new Timer(EndCurrentPlayerTurn, this, Timeout.Infinite, Timeout.Infinite); foreach (var question in r.Quiz.Questions) { this.Questions.Enqueue(question); } this.QuizId = r.Quiz.Id; this.EventDespatcher = new DespawnDespatcher(this); }
internal Game(Room r) { this.Parent = r; this.TotalQuestion = (byte)r.NoOfQuestion; this.Questions = new Queue <Question>(); this.RewardManager = new RewardManager(); this.PlayerManager = new PlayerManager(); this.Guid = Guid.NewGuid(); this.TurnTimer = new Timer(EndCurrentPlayerTurn, this, Timeout.Infinite, Timeout.Infinite); QuizId = r.Quiz.Id; foreach (var client in r.Clients) { client.Character.Status.Update(this); PlayerManager.Add(client); } // no Wiping client // r.Clients.Clear(); PlayerManager.Setup(); this.EventDespatcher = new DespawnDespatcher(this); SetupBoard(); }