Struct HudState
Immutable snapshot of the HUD (Heads-Up Display) state.
Represents what the HUD should display, not how it is rendered.
Assembly: Serenity.GameUi.Domain.dll
Syntax
public readonly struct HudState : IEquatable<HudState>
Constructors
HudState(bool, bool)
Creates a new HudState with the specified visibility and pause state.
Declaration
public HudState(bool isVisible, bool isPaused)
Parameters
| Type |
Name |
Description |
| bool |
isVisible |
Whether the HUD is visible.
|
| bool |
isPaused |
Whether the HUD is in a paused state.
|
HudState(bool, bool, string)
Creates a new HudState that also names which HUD definition to show.
Declaration
public HudState(bool isVisible, bool isPaused, string activeHudId)
Parameters
| Type |
Name |
Description |
| bool |
isVisible |
Whether the HUD is visible.
|
| bool |
isPaused |
Whether the HUD is in a paused state.
|
| string |
activeHudId |
The HUD definition to show; empty to leave the current one in place.
|
Fields
ActiveHudId
The id of the HUD definition to show, or empty when the presenter should keep whatever it already has.
Declaration
public readonly string ActiveHudId
Field Value
Remarks
IsPaused
Whether the HUD is in a paused display state.
Declaration
public readonly bool IsPaused
Field Value
IsVisible
Whether the HUD is currently visible.
Declaration
public readonly bool IsVisible
Field Value
Properties
Default
A default HudState with the HUD visible and not paused.
Declaration
public static HudState Default { get; }
Property Value
HasActiveHudId
Whether a specific HUD definition is named.
Declaration
public bool HasActiveHudId { get; }
Property Value
Hidden
A HudState representing a hidden HUD.
Declaration
public static HudState Hidden { get; }
Property Value
Methods
Equals(HudState)
Declaration
public bool Equals(HudState other)
Parameters
Returns
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| object |
obj |
|
Returns
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
ToString()
Renders the state for logs. The HUD id is only appended when one is set, so the long-standing
two-flag format is unchanged for states that do not name a definition.
Declaration
public override string ToString()
Returns
Overrides
WithActiveHudId(string)
Returns this state with a different HUD definition named.
Declaration
public HudState WithActiveHudId(string activeHudId)
Parameters
| Type |
Name |
Description |
| string |
activeHudId |
The HUD definition to show; empty to leave the current one in place.
|
Returns
Operators
operator ==(HudState, HudState)
Declaration
public static bool operator ==(HudState left, HudState right)
Parameters
Returns
operator !=(HudState, HudState)
Declaration
public static bool operator !=(HudState left, HudState right)
Parameters
Returns
Implements