GameOrchestrator
The centralized coordinator for all gameplay service providers in the m00m architecture. It handles initialization, environment configuration, and lifecycle management for authentication, user data, and game data services.
public class GameOrchestrator
Purpose
- Acts as a service hub for gameplay-related systems
- Coordinates startup and teardown logic across services
- Ensures consistent environment configuration (
development,beta,production) - Responds to authentication state changes
Members
IAuthenticationProvider authProvider
Default: FirebaseAuthenticationProvider
Manages sign-in/sign-out flows and user session state.
IUserDetailProvider userDetailProvider
Default: FirebaseUserDetailProvider
Tracks and updates user-specific profile data.
IGameDataProvider gameDataProvider
Default: FirebaseGameDataProvider
Handles game-specific inventory, interior, and reward data.
bool SetEnvironment(string env)
Configures the runtime environment across all service providers. Supports "development", "beta", and "production".
void Initialize()
Initializes all providers, sets the environment, and subscribes to authentication events.
void Release()
Calls Release() on all orchestrated services for cleanup or scene transitions.
Lifecycle Behavior
- First Launch: Initializes each provider with a reference to
thisorchestrator. - Environment Selection: Automatically picks the right environment (
productionfor release builds,developmentotherwise). - User State Monitoring: Listens for auth status changes and fetches updated user profile on login.
Related Interfaces
var orchestrator = new GameOrchestrator();
orchestrator.Initialize();
Call Release() when your game session ends or before transitioning contexts.