public void AddInstance() { CurrentHPCount.Add(HitPoints); Number = CurrentHPCount.Count(); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Number))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(CurrentHPCount))); }
public Monster(dynamic jsonObject) { Name = jsonObject.name; Meta = jsonObject.meta; Languages = jsonObject.Languages == "--" ? null : jsonObject.Languages; Senses = jsonObject.Senses; HitPoints = StatBlockParser.ParseHP(jsonObject.HitPoints); ChallengeRating = StatBlockParser.ParseChallengeRating(jsonObject.Challenge); ArmourClass = StatBlockParser.ParseAC(jsonObject.ArmorClass); CurrentHitPoints = HitPoints; CurrentHPCount.Add(HitPoints); Speed = jsonObject.Speed; DamageResistances = jsonObject.Damage_Resistances; DamageImmunities = jsonObject.Damage_Immunities; ConditionImmunities = jsonObject.Condition_Immunities; SavingThrows = jsonObject.SavingThrows; Skills = jsonObject.Skills; ParseActions(jsonObject); Strength = (byte)jsonObject.STR; Dexterity = (byte)jsonObject.DEX; Constitution = (byte)jsonObject.CON; Intelligence = (byte)jsonObject.INT; Wisdom = (byte)jsonObject.WIS; Charisma = (byte)jsonObject.CHA; ImgURL = jsonObject.img_url; SetModifiers(); }
public void RemoveInstance() { if (Number == 1) { return; } else { CurrentHPCount.RemoveAt(Number - 1); Number = CurrentHPCount.Count(); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Number))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(CurrentHPCount))); } }