Пример #1
0
        private void ValidateGameSession(TAccountModel[] players)
        {
            var lobby = new MatchWaiting <TAccountModel>(players, _host);

            lobby.OnValidateSuccess += CreateGameSession;
            lobby.BackToQueue       += ReturnToQueue;
        }
Пример #2
0
 private void CreateGameSession(MatchWaiting <TAccountModel> sender, TAccountModel[] players)
 {
     sender.BackToQueue       -= ReturnToQueue;
     sender.OnValidateSuccess -= CreateGameSession;
     if (RoomCreated != null)
     {
         RoomCreated.Invoke(players);
     }
 }
Пример #3
0
 private void ReturnToQueue(MatchWaiting <TAccountModel> sender, TAccountModel[] players)
 {
     sender.BackToQueue       -= ReturnToQueue;
     sender.OnValidateSuccess -= CreateGameSession;
     foreach (var p in players)
     {
         _playerQueue.AddPlayer(p);
     }
 }