data_object Properties 4

Armour
float
Current armour, for others to read and restore. Set it to recharge. How armour absorbs damage, clamping, and what happens at zero are the implementer's business. Reads 0 and ignores writes unless the implementer provides it. A class's own public float Armour { get; set; } implements this implicitly, under the same rules as Sandbox.Component.IDamageable.Health.
Health
float
Current health, for others to read and restore. Set it to heal. To hurt, deal damage through Sandbox.Component.IDamageable.OnDamage(Sandbox.DamageInfo@) instead: setting this raises no damage events. Clamping, and what happens at zero, are the implementer's business. Reads 0 and ignores writes unless the implementer provides it. A class's own public float Health { get; set; } implements this implicitly. Accessors bind one by one and nothing warns when they do not. With a public getter but a private, protected, internal or missing setter, reads work and writes are dropped. A property of another type or name, a field, a static or a non-public property does not bind at all, and this reads 0. A subclass does not bind what it adds to a base that already implements Sandbox.Component.IDamageable, unless it lists the interface again. Such a class implements this member explicitly.
MaxArmour
float
The most armour this normally has, which recharging should stop at. 0 means it has no armour that others can read or restore, which callers check before they use Sandbox.Component.IDamageable.Armour. A class's own public float MaxArmour getter implements this implicitly, under the same rules as Sandbox.Component.IDamageable.Health.
MaxHealth
float
The most health this normally has, which healing should stop at. 0 means it has no health that others can read or restore, which callers check before they use Sandbox.Component.IDamageable.Health. An object can carry several damageables, such as one that only forwards damage, so look for the one that has a maximum. A class's own public float MaxHealth getter implements this implicitly, under the same rules as Sandbox.Component.IDamageable.Health.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.