Exemplo n.º 1
0
 public List <SkillModel> GetSkills()
 {
     try
     {
         return(_skillRepository.GetSkills()
                .ToList());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 2
0
        public ICollection <Skill> GetSkills(string characterName, SkillType type)
        {
            CharacterSkills characterSkills = Retrieve <CharacterSkills>($"characters/{characterName}/skills");

            ICollection <Skill> skills     = new List <Skill>();
            SkillRepository     repository = new SkillRepository();

            switch (type)
            {
            case (SkillType.PvE):
                skills = repository.GetSkills(GetSkillIds(characterSkills.SkillsInformation.PvE));
                break;

            case (SkillType.PvP):
                skills = repository.GetSkills(GetSkillIds(characterSkills.SkillsInformation.PvP));
                break;

            case (SkillType.WvW):
                skills = repository.GetSkills(GetSkillIds(characterSkills.SkillsInformation.WvW));
                break;
            }

            return(skills);
        }
Exemplo n.º 3
0
        private async void showSkills(int?ClassID)
        {
            SkillRepository s = new SkillRepository();

            try
            {
                List <Skill> skills;
                if (ClassID.GetValueOrDefault() > 0)
                {
                    skills = await s.GetSkillByClass(ClassID.GetValueOrDefault());
                }
                else
                {
                    skills = await s.GetSkills();
                }
                skillList.ItemsSource = skills;
                skillList.IsVisible   = true;
            }
            catch (Exception ex)
            {
                if (ex.InnerException != null)
                {
                    if (ex.GetBaseException().Message.Contains("connection with the server"))
                    {
                        await DisplayAlert("Error", "No connection with the server. Check that the Web Service is running and available and then click the Refresh button.", "Ok");
                    }
                    else
                    {
                        await DisplayAlert("Error", "If the problem persists, please call your system administrator.", "Ok");
                    }
                }
                else
                {
                    await DisplayAlert("General Error", "If the problem persists, please call your system administrator.", "Ok");
                }
            }
        }
Exemplo n.º 4
0
        public IHttpActionResult GetSkills()
        {
            var skills = _skillRepository.GetSkills();

            return(Ok(skills));
        }
Exemplo n.º 5
0
 public void GetSkills_Returns_CorrectNumber()
 {
     Assert.AreEqual(16, skillRepository.GetSkills().Count());
 }