示例#1
0
        private void CheckPlayerKillAchivement()
        {
            Achivement achivement = new Achivement
            {
                Name     = achivementName[3],
                PlayerId = player.Id
            };

            if (!CheckIfAchivementExist(achivement))
            {
                long countPlayerKill = playerKillrepository.GetCountFromMurderer(player.Id);
                if (countPlayerKill >= 70)
                {
                    achivementRepository.AddAchivement(achivement);
                    TriggerFeedBackAchivement(achivement);
                }
            }
        }
示例#2
0
        private void CheckProtectionOfPlayerAchivement()
        {
            Achivement achivement = new Achivement
            {
                Name     = achivementName[1],
                PlayerId = player.Id
            };

            if (!CheckIfAchivementExist(achivement))
            {
                IList <ProtectionOfPlayer> listAllProtection = protectionOfPlayerRepository.GetAllLevel3EntryOfPlayer(player.Id);
                if (listAllProtection != null)
                {
                    bool helmet = false;
                    bool vest   = false;
                    bool bag    = false;
                    foreach (ProtectionOfPlayer item in listAllProtection)
                    {
                        if (item.TypeProtection == ItemType.Bag.ToString())
                        {
                            bag = true;
                        }
                        else if (item.TypeProtection == ItemType.Helmet.ToString())
                        {
                            helmet = true;
                        }
                        else if (item.TypeProtection == ItemType.Vest.ToString())
                        {
                            vest = true;
                        }
                    }
                    if (helmet && bag && vest)
                    {
                        achivementRepository.AddAchivement(achivement);
                        TriggerFeedBackAchivement(achivement);
                    }
                }
            }
        }
示例#3
0
 public virtual void DeleteAllAchivementWithName(Achivement achivement)
 {
     repository.DeleteAllAchivementWithName(achivement.Name);
 }
示例#4
0
 public virtual Achivement GetAchivementFromId(Achivement achivement)
 {
     return(repository.GetAchivementFromId(achivement.Id));
 }
示例#5
0
 public virtual Achivement GetAchivementFromName(Achivement achivement)
 {
     return(repository.GetAchivementFromName(achivement.Name));
 }
示例#6
0
 public virtual void AddAchivement(Achivement achivement)
 {
     repository.AddAchivement(achivement);
 }