/// <summary> /// This is where it all begins! /// </summary> /// <param name="photonPlugin"></param> /// <param name="messenger"></param> /// <param name="playerManager"></param> /// <returns></returns> public ITAlertRoomStateController Create(PluginBase photonPlugin, Messenger messenger, ITAlertPlayerManager playerManager, ExceptionHandler exceptionHandler) { var sugarAnalytics = new AnalyticsServiceAdapter(); var analytics = new AnalyticsServiceManager(sugarAnalytics); var roomSettings = new RoomSettings(photonPlugin); var exceptionTransition = new EventTransition(ErrorState.StateName); exceptionHandler.ExceptionEvent += e => exceptionTransition.ChangeState(); var lobbyState = new LobbyState(photonPlugin, messenger, playerManager, roomSettings, analytics); var gameStartedTransition = new EventTransition(GameState.StateName); lobbyState.GameStartedEvent += gameStartedTransition.ChangeState; lobbyState.AddTransitions(gameStartedTransition); var gameState = new GameState(photonPlugin, messenger, playerManager, roomSettings, analytics, exceptionHandler); gameState.AddTransitions(exceptionTransition); var errorState = new ErrorState(photonPlugin, messenger, playerManager, roomSettings, analytics, exceptionHandler); var controller = new ITAlertRoomStateController(lobbyState, gameState, errorState); gameState.ParentStateController = controller; return(controller); }
public LobbyState(PluginBase photonPlugin, Messenger messenger, ITAlertPlayerManager playerManager, RoomSettings roomSettings, AnalyticsServiceManager analytics) : base(photonPlugin, messenger, playerManager, roomSettings, analytics) { }
protected ITAlertRoomState(PluginBase photonPlugin, Messenger messenger, ITAlertPlayerManager playerManager, RoomSettings roomSettings, AnalyticsServiceManager analytics) : base(photonPlugin, messenger, playerManager) { RoomSettings = roomSettings; Analytics = analytics; }
public InitializingState(SimulationLifecycleManager simulationLifecycleManager, PluginBase photonPlugin, Messenger messenger, ITAlertPlayerManager playerManager, RoomSettings roomSettings, AnalyticsServiceManager analytics) : base(photonPlugin, messenger, playerManager, roomSettings, analytics) { _simulationLifecycleManager = simulationLifecycleManager; }
public ErrorState(PluginBase photonPlugin, Messenger messenger, ITAlertPlayerManager playerManager, RoomSettings roomSettings, AnalyticsServiceManager analytics, ExceptionHandler exceptionHandler) : base(photonPlugin, messenger, playerManager, roomSettings, analytics) { _exceptionHandler = exceptionHandler; }
public GameState(PluginBase photonPlugin, Messenger messenger, ITAlertPlayerManager playerManager, RoomSettings roomSettings, AnalyticsServiceManager analytics, ExceptionHandler exceptionHandler) : base(photonPlugin, messenger, playerManager, roomSettings, analytics) { _scenarioLoader = new ScenarioLoader(); _exceptionHandler = exceptionHandler; }