public WeaponSpecValue(Player player, WeaponSlot slot) { this.player = player; this.slot = slot; this.toHitAdjustments = new BasicAdjustmentList(); this.damageAdjustments = new BasicAdjustmentList(); player.PropertyChanged += new PropertyChangedEventHandler(player_PropertyChanged); playerWeapon = Weapon; if (Weapon != null) { Weapon.PropertyChanged += new PropertyChangedEventHandler(Weapon_PropertyChanged); } if (Weapon != null) { weaponBonus = player.WeaponBonuses[Weapon]; if (weaponBonus != null) { weaponBonus.PropertyChanged += new PropertyChangedEventHandler(bonus_PropertyChanged); } } toHitAdjustments.ContainedElementChanged += new PropertyChangedEventHandler(toHitAdjustments_ContainedElementChanged); toHitAdjustments.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(toHitAdjustments_CollectionChanged); damageAdjustments.ContainedElementChanged += new PropertyChangedEventHandler(damageAdjustments_ContainedElementChanged); damageAdjustments.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(damageAdjustments_CollectionChanged); }
public WeaponBonus(Weapon weapon, WeaponBonusValue bonus) { this.weapon = weapon; this.bonus = bonus; }
public void Add(Weapon weapon, WeaponBonusValue bonus) { this.Add(new WeaponBonus(weapon, bonus)); }