Esempio n. 1
0
 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());
 }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
 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();
 }