BusinessLogic.Logic.Achievements.ChampionAchievement.IsAwardedForThisPlayer C# (CSharp) Метод

IsAwardedForThisPlayer() публичный Метод

public IsAwardedForThisPlayer ( int playerId ) : AchievementAwarded
playerId int
Результат AchievementAwarded
        public override AchievementAwarded IsAwardedForThisPlayer(int playerId)
        {
            var result = new AchievementAwarded
            {
                AchievementId = this.Id
            };

            var championedGames =
                DataContext.GetQueryable<Champion>()
                    .Where(c => c.PlayerId == playerId)
                    .Select(c => c.GameDefinitionId)
                    .Distinct()
                    .ToList();
            
            if (championedGames.Any())
            {
                var count = championedGames.Count;
                result.LevelAwarded = GetLevelAwarded(count);
                result.PlayerProgress = count;
                result.RelatedEntities = championedGames.ToList();
            }
            
            return result;
        }
    }