using ShiroginSDK.Runtime.Services.Base;
using ShiroginSDK.Runtime.Services.Implementations.Ads;
using ShiroginSDK.Runtime.Services.Implementations.Analytics;
using ShiroginSDK.Runtime.Services.Implementations.AppsFlyerServiceNS;
using ShiroginSDK.Runtime.Services.Implementations.Core;
using ShiroginSDK.Runtime.Services.Implementations.Data;
using ShiroginSDK.Runtime.Services.Implementations.Facebook;
using ShiroginSDK.Runtime.Services.Implementations.Firebase;
using ShiroginSDK.Runtime.Services.Implementations.IAP;
using ShiroginSDK.Runtime.Services.Implementations.RemoteConfig;
using ShiroginSDK.Runtime.Services.Implementations.UI;
using ShiroginSDK.Runtime.Services.Interfaces;
using UnityEngine;
namespace ShiroginSDK.Runtime.Services.Registry
{
///
/// Central orchestrator for initializing all ShiroginSDK services in proper dependency order.
///
public static class ShiroginServiceRegistry
{
public static void InitializeAll()
{
// ------------------------------------------------------------------
// ๐งฉ CORE LAYER
// ------------------------------------------------------------------
RegisterAndInit(new EventService()); // Events backbone
RegisterAndInit(new DataService()); // Save/Load system
RegisterAndInit(new CoroutineRunnerService()); // Global coroutine executor
// ------------------------------------------------------------------
// ๐ฅ BACKEND LAYER
// ------------------------------------------------------------------
RegisterAndInit(new FirebaseService()); // Firebase Analytics + Remote Config
RegisterAndInit(new RemoteConfigService()); // Uses FirebaseService
RegisterAndInit(new AppsFlyerService()); // AppsFlyer analytics SDK
RegisterAndInit(new FacebookService()); // Facebook SDK
RegisterAndInit(new AnalyticsService()); // Unified analytics forwarding
// ------------------------------------------------------------------
// ๐ฐ ECONOMY & ADS
// ------------------------------------------------------------------
RegisterAndInit(new IAPService()); // In-app purchases
RegisterAndInit(new AdsService()); // Rewarded & Interstitial ads
// ------------------------------------------------------------------
// ๐จ UI / PRESENTATION LAYER
// ------------------------------------------------------------------
RegisterAndInit(new ThemeService()); // UI themes / skins
RegisterAndInit(new PopupService()); // Global popup queue system
Debug.Log("[ShiroginSDK] โ
All services initialized successfully.");
}
///
/// Registers and initializes a service with its interface type.
///
private static void RegisterAndInit(ServiceBase service) where TInterface : class
{
// Register by interface type
ServiceLocator.Register((TInterface)(object)service);
service.Initialize();
}
public static void DisposeAll()
{
ServiceLocator.Clear();
Debug.Log("[ShiroginSDK] ๐งน All services disposed.");
}
}
}