| name | feature-handling |
| description | EGM feature detection and handling during game cycles. Use when handling free games, re-spins, wheel bonuses, gamble features, win counting, intermediate acknowledgement screens, or feature chooser menus. Covers: GameFlowStatusProvider, RunningFeatures, FeatureTypes constants, GameFeatureController, GambleController, ReSpinController, WheelBonusController, WinCountingStatusProvider, StartGame button to dismiss screens. stages: test-implementation, test-validation |
Feature Handling
When to Use
- Handling bonus features triggered during a game cycle
- Detecting active features (free games, re-spins, wheel bonuses)
- Dismissing intermediate announcement/award screens
- Waiting for win counting to complete
- Managing gamble offers after wins
Feature Detection
Features are detected via GameFlowStatusProvider.GetRunningFeaturesTypeAsync(), which reads StatusDatabasePaths.GameFlowStatus.RunningFeatures — a JsonArray of JsonObject elements with a "Type" property.
Feature Type Constants (FeatureTypes.cs)
| Constant | Value | Description |
|---|
FeatureTypes.BaseGame | "BaseGame" | Standard base game |
FeatureTypes.FreeGame | "FreeGame" | Free spins feature |
FeatureTypes.ReSpinFeature | "ReSpinFeature" | Re-spin feature |
FeatureTypes.WheelBonus | "WheelBonus" | Wheel bonus feature |
Handling Order
GameFeatureController handles features in this order:
- ReSpin →
ReSpinController
- WheelBonus →
WheelBonusController
- Gamble →
GambleController
Each feature may present an intermediate screen requiring a button press to advance.
GameFeatureController Usage
await gameFeatureController.HandleAllActiveFeaturesAsync(CancellationToken);
This should be called in a loop during game cycle polling (see game-cycle skill):
while (await gameStatusProvider.IsGameCycleActiveAsync())
{
await gameFeatureController.HandleAllActiveFeaturesAsync(CancellationToken);
await Task.Delay(GameCompletionPollIntervalMs, cts.Token);
}
Intermediate Acknowledgement Screens
Many EGM state transitions display announcement/award screens that block progression until the player presses a button:
- Free game award banners ("You have won X free games!")
- Feature chooser menus
- Bonus outcome screens
- Denomination selection confirmations
The StartGame button (ButtonNames.GameplayButtons.StartGame) serves a dual purpose: it starts game rounds AND dismisses intermediate screens.
Tests should account for these blockers in polling loops using the unblock pattern (see polling-patterns skill).
Win Counting
After a winning game cycle, the EGM enters a win-counting phase:
WinCountingStatusProvider.GetWinRollupStatusAsync() returns "Counting" during rollup or "Idle" when complete.
- The gamble feature is only accessible during/after counting (
"Counting" or "Idle").
- Use
WinCountingStatusProvider.IsWinRollupIdleAsync() to wait for counting to finish.
Required Dependencies
Tests that handle features MUST wire these in [SetUp]:
var gambleController = new GambleController(
gameSpeedController, buttonsFacade, gambleStatusProvider, winCountingStatusProvider);
var reSpinController = new ReSpinController(buttonsFacade, gameFlowStatusProvider);
var wheelBonusController = new WheelBonusController(buttonsFacade, gameFlowStatusProvider);
var gameFeatureController = new GameFeatureController(
gambleController, reSpinController, wheelBonusController);