Interface IGameUiService
Service interface for managing the abstract UI state of a game session.
Namespace: Serenity.GameUi.Application.Interfaces
Assembly: Serenity.GameUi.Application.dll
Syntax
public interface IGameUiService : IService, IFoundationSettings
Remarks
UI is treated as state, not as widgets. This service manages what the UI represents (active screen, HUD state, results state) while remaining unaware of how or where the UI is rendered.
Properties
ActiveScreen
Gets the currently active screen identifier.
Declaration
UiScreenId ActiveScreen { get; }
Property Value
| Type | Description |
|---|---|
| UiScreenId |
CurrentHudState
Gets the current HUD state.
Declaration
HudState CurrentHudState { get; }
Property Value
| Type | Description |
|---|---|
| HudState |
CurrentResultsState
Gets the current results screen state.
Declaration
ResultsState CurrentResultsState { get; }
Property Value
| Type | Description |
|---|---|
| ResultsState |
Methods
HideHud()
Hides the HUD.
Declaration
void HideHud()
HideResults()
Hides the results screen.
Declaration
void HideResults()
SetActiveScreen(UiScreenId)
Sets the active screen.
Declaration
void SetActiveScreen(UiScreenId screenId)
Parameters
| Type | Name | Description |
|---|---|---|
| UiScreenId | screenId | The screen to activate. |
SetHudState(HudState)
Updates the HUD state.
Declaration
void SetHudState(HudState hudState)
Parameters
| Type | Name | Description |
|---|---|---|
| HudState | hudState | The new HUD state. |
ShowHud()
Shows the HUD with default settings.
Declaration
void ShowHud()
ShowResults(bool, float)
Shows the results screen with the specified outcome.
Declaration
void ShowResults(bool isVictory, float finalTime)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | isVictory | Whether the session was a victory. |
| float | finalTime | The final elapsed time in seconds. |