示例#1
0
        public int GetTargetRankingsByShard(Guid shardId, Guid characterId)
        {
            Bounty bounty = new Bounty();
            var topPlayers = new List<TopPlayers>();

            // Find all characters for the provided shardid
            IEnumerable<Character> characterList = this.db.Characters.Where(c => c.ShardId == shardId);

            // get placed on count for each character
            foreach (Character characterListItem in characterList)
            {
                topPlayers.Add(new TopPlayers
                {
                    CharacterId = characterListItem.Id,
                    count = bounty.GetBountiesPlacedOnCount(characterListItem.Id)
                });
            }

            // sort by killed count
            List<TopPlayers> sortedTopPlayers = topPlayers.OrderBy(c => c.count).ThenBy(c => c.CharacterId).Reverse().ToList();

            // find position in the list

            return (sortedTopPlayers.IndexOf(sortedTopPlayers.Where(c => c.CharacterId == characterId).Single()) + 1);
        }
示例#2
0
        public int GetBountiesPlacedOnCount(Guid characterId)
        {
            Bounty bounty = new Bounty();

            return bounty.GetBountiesPlacedOnCount(characterId);
        }