コード例 #1
0
 public SchoolInfo(SchoolTypes type, Regions region, string name, string adress, string code)
 {
     SchoolType   = type;
     SchoolRegion = region;
     SchoolName   = name;
     SchoolAdress = adress;
     SchoolCode   = code;
 }
コード例 #2
0
        public async Task <IActionResult> SchoolTypes()
        {
            SchoolTypes SchoolTypesList = new SchoolTypes();
            var         apiResponse     = await httpClientConfig.ApiGetResponse("SchoolType/getAllSchoolType", "");

            SchoolTypesList = JsonConvert.DeserializeObject <SchoolTypes>(apiResponse);

            return(View(SchoolTypesList));
        }
コード例 #3
0
        public async Task <IActionResult> SchoolTypes()
        {
            var         jwtToken        = HttpContext.Session.GetString("Token");
            SchoolTypes SchoolTypesList = new SchoolTypes();
            var         apiResponse     = await httpClientConfig.ApiGetResponse("SchoolType/getAllSchoolType", jwtToken);

            SchoolTypesList = JsonConvert.DeserializeObject <SchoolTypes>(apiResponse);

            return(View(SchoolTypesList));
        }
コード例 #4
0
        protected override TidyData TidyDataFromCsv(string csvLine,
                                                    List <string> headers,
                                                    Guid publicationId,
                                                    int releaseId,
                                                    DateTime releaseDate)
        {
            var headerValues = new[]
            {
                "term", "year", "level", "country_code", "country_name", "school_type", "characteristic_desc",
                "characteristic_1", "characteristic_2"
            };
            var values = csvLine.Split(',');
            var model  = new CharacteristicDataNational
            {
                PublicationId = publicationId,
                ReleaseId     = releaseId,
                ReleaseDate   = releaseDate,
                Year          = int.Parse(values[headers.FindIndex(h => h.Equals("year"))]),
                Level         = Levels.EnumFromStringForImport(values[headers.FindIndex(h => h.Equals("level"))]),
                Country       = new Country
                {
                    Code = values[headers.FindIndex(h => h.Equals("country_code"))],
                    Name = values[headers.FindIndex(h => h.Equals("country_name"))]
                },
                SchoolType =
                    SchoolTypes.EnumFromStringForImport(values[headers.FindIndex(h => h.Equals("school_type"))]),
                Attributes     = new Dictionary <string, string>(),
                Characteristic = new Characteristic
                {
                    Name        = values[headers.FindIndex(h => h.Equals("characteristic_1"))],
                    Name2       = values[headers.FindIndex(h => h.Equals("characteristic_2"))],
                    Description = values[headers.FindIndex(h => h.Equals("characteristic_desc"))]
                }
            };

            if (headers.Contains("term"))
            {
                model.Term = values[headers.FindIndex(h => h.Equals("term"))];
            }

            for (var i = 0; i < values.Length; i++)
            {
                if (!headerValues.Contains(headers[i]))
                {
                    model.Attributes.Add(headers[i], values[i]);
                }
            }

            return(model);
        }
コード例 #5
0
ファイル: FindSchool.cs プロジェクト: pid011/SchoolFinder
        public List <SchoolInfo> SearchSchoolInfo(SchoolTypes type, Regions region, string searchWord)
        {
            var url = defaultUrl;

            url += "&gubun=" + SchoolTypesToString(type);
            url += "&region=" + RegionsToString(region);
            url += "&searchSchulNm=" + searchWord;

            var json   = Util.GetTextFromUrl(url);
            var result = SchoolJsonParser(json);

            result.ForEach(x => { x.Region = region; x.SchoolType = type; });

            return(result);
        }
コード例 #6
0
        /// <summary>
        /// 매개변수로 받은 검색단어로 학교를 검색하여 검색어와 유사한 학교들을 리턴합니다.
        /// </summary>
        /// <param name="type"></param>
        /// <param name="region">검색할 학교의 관할지역</param>
        /// <param name="searchWord"></param>
        /// <returns>검색결과</returns>
        public List <SchoolInfo> SearchSchool(SchoolTypes type, Regions region, string searchWord)
        {
            var infos = new FindSchool().SearchSchoolInfo(type, region, searchWord);
            var codes = new FindSchoolCode().SearchSchoolCode(region, searchWord);

            foreach (var item in infos)
            {
                if (codes.Exists(x => x.Name == item.Name))
                {
                    item.Code = codes.Find(x => x.Name == item.Name).Code;
                }
            }
            infos.RemoveAll(x => x.Code == null);

            return(infos);
        }
コード例 #7
0
ファイル: Ability.cs プロジェクト: csecong/Mud.Net
        }                                           // IReadOnlyCollection

        #endregion

        public Ability(int id, string name, AbilityTargets target, AbilityBehaviors behavior, AbilityKinds kind, ResourceKinds resourceKind, AmountOperators costType, int costAmount, int globalCooldown, int cooldown, int duration, SchoolTypes school, AbilityMechanics mechanic, DispelTypes dispelType, AbilityFlags flags, params AbilityEffect[] effects)
        {
            Id             = id;
            Name           = name;
            Target         = target;
            Behavior       = behavior;
            Kind           = kind;
            ResourceKind   = resourceKind;
            CostType       = costType;
            CostAmount     = costAmount;
            GlobalCooldown = globalCooldown;
            Cooldown       = cooldown;
            Duration       = duration;
            School         = school;
            Mechanic       = mechanic;
            DispelType     = dispelType;
            Flags          = flags;
            Effects        = effects?.ToList();
        }
コード例 #8
0
ファイル: FindSchool.cs プロジェクト: pid011/SchoolFinder
        private string SchoolTypesToString(SchoolTypes type)
        {
            string result = string.Empty;

            switch (type)
            {
            case SchoolTypes.Elementary:
                result = "elem_list";
                break;

            case SchoolTypes.Middle:
                result = "midd_list";
                break;

            case SchoolTypes.High:
                result = "high_list";
                break;

            default:
                break;
            }

            return(result);
        }
コード例 #9
0
 public IPeriodicAura AddPeriodicAura(ICharacter victim, IAbility ability, ICharacter source, SchoolTypes school, int amount, AmountOperators amountOperator, bool tickVisible, int tickDelay, int totalTicks)
 {
     throw new NotImplementedException();
 }
コード例 #10
0
        protected override TidyData TidyDataFromCsv(string csvLine,
                                                    List <string> headers,
                                                    Guid publicationId,
                                                    int releaseId,
                                                    DateTime releaseDate)
        {
            var headerValues = new[]
            {
                "term", "year", "level", "country_code", "country_name", "region_code", "region_name", "old_la_code",
                "new_la_code", "la_name", "estab", "laestab", "urn", "academy_type", "academy_open_date", "school_type"
            };
            var values = csvLine.Split(',');

            var model = new GeographicData
            {
                PublicationId = publicationId,
                ReleaseId     = releaseId,
                ReleaseDate   = releaseDate,
                Year          = int.Parse(values[headers.FindIndex(h => h.Equals("year"))]),
                Level         = Levels.EnumFromStringForImport(values[headers.FindIndex(h => h.Equals("level"))]),
                Country       = new Country
                {
                    Code = values[headers.FindIndex(h => h.Equals("country_code"))],
                    Name = values[headers.FindIndex(h => h.Equals("country_name"))]
                },
                Region = new Region
                {
                    Code = values[headers.FindIndex(h => h.Equals("region_code"))],
                    Name = values[headers.FindIndex(h => h.Equals("region_name"))]
                },
                LocalAuthority = new LocalAuthority
                {
                    Old_Code = values[headers.FindIndex(h => h.Equals("old_la_code"))],
                    Code     = values[headers.FindIndex(h => h.Equals("new_la_code"))],
                    Name     = values[headers.FindIndex(h => h.Equals("la_name"))]
                },
                School = new School
                {
                    Estab           = values[headers.FindIndex(h => h.Equals("estab"))],
                    LaEstab         = values[headers.FindIndex(h => h.Equals("laestab"))],
                    AcademyOpenDate = values[headers.FindIndex(h => h.Equals("academy_open_date"))],
                    AcademyType     = values[headers.FindIndex(h => h.Equals("academy_type"))]
                },
                SchoolType =
                    SchoolTypes.EnumFromStringForImport(values[headers.FindIndex(h => h.Equals("school_type"))]),
                Attributes = new Dictionary <string, string>()
            };

            if (headers.Contains("urn"))
            {
                model.School.Urn = values[headers.FindIndex(h => h.Equals("urn"))];
            }

            if (headers.Contains("term"))
            {
                model.Term = values[headers.FindIndex(h => h.Equals("term"))];
            }

            for (var i = 0; i < values.Length; i++)
            {
                if (!headerValues.Contains(headers[i]))
                {
                    model.Attributes.Add(headers[i], values[i]);
                }
            }

            return(model);
        }
コード例 #11
0
        public IPeriodicAura AddPeriodicAura(ICharacter victim, IAbility ability, ICharacter source, SchoolTypes school, int amount, AmountOperators amountOperator, bool tickVisible, int tickDelay, int totalTicks)
        {
            IPeriodicAura periodicAura = new PeriodicAura(ability, PeriodicAuraTypes.Damage, source, school, amount, amountOperator, tickVisible, tickDelay, totalTicks);

            victim.AddPeriodicAura(periodicAura);
            return(periodicAura);
        }
コード例 #12
0
 public PeriodicAura(IAbility ability, PeriodicAuraTypes auraType, ICharacter source, SchoolTypes school, int amount, AmountOperators amountOperator, bool tickVisible, int tickDelay, int totalTicks)
     : this(ability, auraType, source, amount, amountOperator, tickVisible, tickDelay, totalTicks)
 {
     School = school;
 }
コード例 #13
0
ファイル: AbilityEffects.cs プロジェクト: csecong/Mud.Net
 public DamageAbilityEffect(decimal factor, SecondaryAttributeTypes attribute, SchoolTypes school)
 {
     Factor    = factor;
     Attribute = attribute;
     School    = school;
 }
コード例 #14
0
ファイル: AbilityEffects.cs プロジェクト: csecong/Mud.Net
 public DamageOrHealEffect(decimal damageFactor, decimal healFactor, SecondaryAttributeTypes attribute, SchoolTypes school)
 {
     DamageFactor = damageFactor;
     HealFactor   = healFactor;
     Attribute    = attribute;
     School       = school;
 }
コード例 #15
0
ファイル: AbilityEffects.cs プロジェクト: csecong/Mud.Net
        protected void PerformDamage(ICharacter source, ICharacter victim, IAbility ability, CombatHelpers.AttackResults attackResult, int damage, SchoolTypes damageType)
        {
            if (ability.Kind == AbilityKinds.Skill)
            {
                // TODO: refactor same code in Character.OneHit
                switch (attackResult)
                {
                case CombatHelpers.AttackResults.Miss:
                case CombatHelpers.AttackResults.Dodge:
                case CombatHelpers.AttackResults.Parry:
                    return;     // no damage

                case CombatHelpers.AttackResults.Block:
                    damage = (damage * 7) / 10;
                    break;

                case CombatHelpers.AttackResults.Critical:
                    // TODO http://wow.gamepedia.com/Critical_strike
                    if (victim.ImpersonatedBy != null)     // PVP
                    {
                        damage = (damage * 150) / 200;
                    }
                    else     // PVE
                    {
                        damage *= 2;
                    }
                    break;

                case CombatHelpers.AttackResults.CrushingBlow:
                    // http://wow.gamepedia.com/Crushing_Blow
                    damage = (damage * 150) / 200;
                    break;

                case CombatHelpers.AttackResults.Hit:
                    // not modified
                    break;
                }
            }
            else if (ability.Kind == AbilityKinds.Spell)
            {
                // Miss/Hit/Critical
                switch (attackResult)
                {
                case CombatHelpers.AttackResults.Miss:
                    return;      // no damage

                case CombatHelpers.AttackResults.Critical:
                    // http://wow.gamepedia.com/Spell_critical_strike
                    damage *= 2;
                    break;

                case CombatHelpers.AttackResults.Hit:
                    // no modifier
                    break;
                }
            }
            victim.AbilityDamage(source, ability, damage, damageType, true);
        }
コード例 #16
0
ファイル: AbilityEffects.cs プロジェクト: csecong/Mud.Net
 public DamageRangeAbilityEffect(int minDamage, int maxDamage, SchoolTypes school)
 {
     MinDamage = minDamage;
     MaxDamage = maxDamage;
     School    = school;
 }