Class CharacterResourcesMask
The bits of Mask, and the rules that produce one.
public static class CharacterResourcesMask
- Inheritance
-
CharacterResourcesMask
- Inherited Members
Remarks
Pure and static so the mask rules can be asserted directly — the interesting cases are a maximum changing, a confirmation, and the first push of a character's life, none of which is reachable from a test that has to spawn one first.
Fields
All
Every field. What a confirmation sends, and what the first push of a life sends.
public const byte All = 63
Field Value
Health
Health is present.
public const byte Health = 1
Field Value
Mana
Mana is present.
public const byte Mana = 4
Field Value
MaxHealth
MaxHealth is present.
public const byte MaxHealth = 2
Field Value
MaxMana
MaxMana is present.
public const byte MaxMana = 8
Field Value
MaxStamina
MaxStamina is present.
public const byte MaxStamina = 32
Field Value
Maxima
The three maxima together.
public const byte Maxima = 42
Field Value
Remarks
They travel as a group. Only one of them changes at a time in practice, but they are the fields a loss strands for longest, and two spare bytes on the handful of pushes that follow an equip is a better trade than three separate sticky counters.
Stamina
Stamina is present.
public const byte Stamina = 16
Field Value
Methods
ChangedFields(in CharacterResourcesBroadcast, in CharacterResourcesBroadcast)
Which fields of next differ from what was last sent.
public static byte ChangedFields(in CharacterResourcesBroadcast previous, in CharacterResourcesBroadcast next)
Parameters
previousCharacterResourcesBroadcastThe last message sent for this character.
nextCharacterResourcesBroadcastThe message about to be sent.
Returns
- byte
The mask of changed fields; zero when nothing moved.
Remarks
Compared against the message the observers were last GIVEN rather than against the sender's float state, so the comparison is against exactly the numbers the receiver holds. Sequence and CharacterObjectID are not fields of the resource sheet and take no part in it.
IncludesMaximum(byte)
True when mask names at least one maximum.
public static bool IncludesMaximum(byte mask)
Parameters
maskbyte