Table of Contents

Class CharacterResourcesMask

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

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

byte

Health

Health is present.

public const byte Health = 1

Field Value

byte

Mana

Mana is present.

public const byte Mana = 4

Field Value

byte

MaxHealth

MaxHealth is present.

public const byte MaxHealth = 2

Field Value

byte

MaxMana

MaxMana is present.

public const byte MaxMana = 8

Field Value

byte

MaxStamina

MaxStamina is present.

public const byte MaxStamina = 32

Field Value

byte

Maxima

The three maxima together.

public const byte Maxima = 42

Field Value

byte

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

byte

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

previous CharacterResourcesBroadcast

The last message sent for this character.

next CharacterResourcesBroadcast

The 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

mask byte

Returns

bool