public SchoolInfo(SchoolTypes type, Regions region, string name, string adress, string code) { SchoolType = type; SchoolRegion = region; SchoolName = name; SchoolAdress = adress; SchoolCode = code; }
public async Task <IActionResult> SchoolTypes() { SchoolTypes SchoolTypesList = new SchoolTypes(); var apiResponse = await httpClientConfig.ApiGetResponse("SchoolType/getAllSchoolType", ""); SchoolTypesList = JsonConvert.DeserializeObject <SchoolTypes>(apiResponse); return(View(SchoolTypesList)); }
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)); }
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); }
public List <SchoolInfo> SearchSchoolInfo(SchoolTypes type, Regions region, string searchWord) { var url = defaultUrl; url += "&gubun=" + SchoolTypesToString(type); url += "®ion=" + 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); }
/// <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); }
} // 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(); }
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); }
public IPeriodicAura AddPeriodicAura(ICharacter victim, IAbility ability, ICharacter source, SchoolTypes school, int amount, AmountOperators amountOperator, bool tickVisible, int tickDelay, int totalTicks) { throw new NotImplementedException(); }
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); }
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); }
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; }
public DamageAbilityEffect(decimal factor, SecondaryAttributeTypes attribute, SchoolTypes school) { Factor = factor; Attribute = attribute; School = school; }
public DamageOrHealEffect(decimal damageFactor, decimal healFactor, SecondaryAttributeTypes attribute, SchoolTypes school) { DamageFactor = damageFactor; HealFactor = healFactor; Attribute = attribute; School = school; }
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); }
public DamageRangeAbilityEffect(int minDamage, int maxDamage, SchoolTypes school) { MinDamage = minDamage; MaxDamage = maxDamage; School = school; }