示例#1
0
        private void PlayerLeftTableEvent(Table obj)
        {
            if (obj == null || string.IsNullOrEmpty(obj.Name) || obj.Players?.FirstOrDefault() == null)
            {
                return;
            }

            var player = _playerBusinessModel.FindPlayerById(obj.Players.FirstOrDefault().Id);
            var table  = _tableRepository.FindTableByName(obj.Name);

            if (table == null || player == null)
            {
                return;
            }

            _tableRepository.RemovePlayerToTable(table, player);
        }
示例#2
0
 public List <TopScore> GetTopTen()
 {
     return(_matchRepository.GetTopTen().Select(x => new TopScore
     {
         Player = _playerBusinessModel.FindPlayerById(x.PlayerId),
         Score = x.Score
     }).OrderBy(x => x.Score).ToList());
 }