示例#1
0
 public JsonResult GetEnemy()
 {
     var heroes = HeroRepository.GetAll();
     var frontHero = new FrontHero(heroes.LastOrDefault());
     return new JsonResult
     {
         Data = SerializeHelper.Serialize(frontHero),
         JsonRequestBehavior = JsonRequestBehavior.AllowGet
     };
 }
示例#2
0
        public JsonResult GetDefaultHero()
        {
            var stateTypes = StateTypeRepository.GetAll();
            var characteristicTypes = CharacteristicTypeRepository.GetAll();

            var skillSchool = SkillSchoolRepository.GetByName(GenerateData.SchoolBaseSkillName);
            var skills = SkillRepository.GetBySchool(skillSchool);

            var hero = GenerateData.GetDefaultHero(stateTypes, characteristicTypes, skills);
            var frontHero = new FrontHero(hero);
            return new JsonResult
            {
                Data = SerializeHelper.Serialize(frontHero),
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            };
        }