Exemplo n.º 1
0
        public List<Guid> GetAllKillShotImageIdsByAccount(Guid accountId, string imageType)
        {
            Character character = new Character();

            var accountCharacters = character.GetAllCharactersForAnAccount(accountId);

            List<Guid> killShotImages = new List<Guid>();

            switch(imageType)
            {
                case "bountiesPlaced":
                    foreach(Character accountCharacter in accountCharacters)
                    {
                        IQueryable<Bounty> completedBountiesPlacedBy = this.db.Bounties.Where(b => b.PlacedById == accountCharacter.Id).Where(b => b.IsCompletionPending == false);

                        foreach(Bounty completedBounty in completedBountiesPlacedBy)
                        {
                            killShotImages.Add(completedBounty.KillShotImageId.Value);
                        }
                    }

                    break;

                case "targetsKilled":
                    foreach(Character accountCharacter in accountCharacters)
                    {
                        IQueryable<Bounty> completedBountiesKilledBy = this.db.Bounties.Where(b => b.KilledById == accountCharacter.Id).Where(b => b.IsCompletionPending == false);

                        foreach(Bounty completedBounty in completedBountiesKilledBy)
                        {
                            killShotImages.Add(completedBounty.KillShotImageId.Value);
                        }
                    }

                    break;

                case "bountiesPlacedOn":
                    foreach(Character accountCharacter in accountCharacters)
                    {
                        IQueryable<Bounty> completedBountiesPlacedOn = this.db.Bounties.Where(b => b.PlacedOnId == accountCharacter.Id).Where(b => b.IsCompletionPending == false);

                        foreach(Bounty completedBounty in completedBountiesPlacedOn)
                        {
                            killShotImages.Add(completedBounty.KillShotImageId.Value);
                        }
                    }

                    break;
            }

            return killShotImages;
        }
Exemplo n.º 2
0
        public List<Bounty> GetAccountPendingBountiesPlaced(Guid accountId)
        {
            Character character = new Character();
            List<Bounty> pendingAccountBounties = new List<Bounty>();

            IEnumerable<Character> accountCharacters = character.GetAllCharactersForAnAccount(accountId);

            foreach(Character accountCharacter in accountCharacters)
            {
                IQueryable<Bounty> pendingBounties = this.GetPendingBountiesPlaced(accountCharacter.Id);

                if(pendingBounties.Count() != 0)
                {
                    foreach(Bounty pendingBounty in pendingBounties)
                    {
                        pendingAccountBounties.Add(pendingBounty);
                    }
                }
            }

            return pendingAccountBounties;
        }
Exemplo n.º 3
0
        public double GetAccountAmountSpent(Guid accountId)
        {
            Character character = new Character();
            double totalSpent = 0;

            IEnumerable<Character> accountCharacters = character.GetAllCharactersForAnAccount(accountId);

            foreach(Character accountCharacter in accountCharacters)
            {
                IQueryable<Bounty> completedBounties = this.GetBountiesPlaced(accountCharacter.Id);

                if(completedBounties.Count() != 0)
                {
                    foreach(Bounty completedBounty in completedBounties)
                    {
                        totalSpent = totalSpent + completedBounty.Amount;
                    }
                }
            }

            return totalSpent;
        }
Exemplo n.º 4
0
        public List<Bounty> GetAccountBountiesPlacedOn(Guid accountId)
        {
            Character character = new Character();
            List<Bounty> accountBounties = new List<Bounty>();

            IEnumerable<Character> accountCharacters = character.GetAllCharactersForAnAccount(accountId);

            foreach(Character accountCharacter in accountCharacters)
            {
                IQueryable<Bounty> completedBounties = this.GetBountiesPlacedOn(accountCharacter.Id);

                if(completedBounties.Count() != 0)
                {
                    foreach(Bounty completedBounty in completedBounties)
                    {
                        accountBounties.Add(completedBounty);
                    }
                }
            }

            return accountBounties;
        }
Exemplo n.º 5
0
        public double GetAccountAmountEarned(Guid accountId)
        {
            Character character = new Character();
            double totalEarned = 0;

            IEnumerable<Character> accountCharacters = character.GetAllCharactersForAnAccount(accountId);

            foreach(Character accountCharacter in accountCharacters)
            {
                List<Bounty> completedBounties = this.GetBountiesCompleted(accountCharacter.Id);

                if(completedBounties.Count() != 0)
                {
                    foreach(Bounty completedBounty in completedBounties)
                    {
                        totalEarned = totalEarned + (completedBounty.Amount * 0.95);
                    }
                }
            }

            return totalEarned;
        }