public PlayerInfo(Player p) { UserId = p.UserId; Level = p.Level; Board = p.Board.Cards; DoorsCount = p.Hand.Cards.Where(x=>x.Type == CardType.Dungeon).Count(); TreasuresCount = p.Hand.Cards.Where(x => x.Type == CardType.Treasure).Count(); }
/// <summary> /// Обработчик события появления нового человека в поиске /// </summary> /// <param name="sender">Собственно User(будет, а пока ClientState)</param> /// <param name="e">//TODO: </param> public void OnNewSearcher(object sender, NewFinderArgs e) { Player player = new Player(sender as User); if (MatchManager.Instance.FindMatchByParticipantID(player.UserId) != null) return; if (Players.Where(x => x.UserId == player.UserId).Count() != 0) return; Players.Add(player); foreach (var p in Players) Longpool.Longpool.Instance.PushMessageToUser(p.UserId, new AsyncMessage(MessageType.QueueStatus, Players.Count)); ResetTimer(); CalculateMatches(); }