public IOGameStateSlotManager(StateConfiguration config, string savesFolderPath) { this.savesFolderPath = savesFolderPath; this.config = config; savePattern = string.Format(config.SaveSlotMask, "*") + $".{Extension}"; quickSavePattern = string.Format(config.QuickSaveSlotMask, "*") + $".{Extension}"; }
public StateManager(StateConfiguration config, EngineConfiguration engineConfig, InputManager inputManager) { this.config = config; this.inputManager = inputManager; var allowUserRollback = config.StateRollbackMode == StateRollbackMode.Full || (config.StateRollbackMode == StateRollbackMode.Debug && Debug.isDebugBuild); var rollbackCapacity = allowUserRollback ? Mathf.Max(1, config.StateRollbackSteps) : 1; // One step is reserved for game save operations. rollbackStateStack = new StateRollbackStack(rollbackCapacity); var savesFolderPath = PathUtils.Combine(engineConfig.GeneratedDataPath, config.SaveFolderName); GameStateSlotManager = new GameStateSlotManager(savesFolderPath, config.SaveSlotMask, config.QuickSaveSlotMask, config.SaveSlotLimit, config.QuickSaveSlotLimit, config.BinarySaveFiles); GlobalStateSlotManager = new GlobalStateSlotManager(savesFolderPath, config.DefaultGlobalSlotId, config.BinarySaveFiles); SettingsSlotManager = new SettingsSlotManager(engineConfig.GeneratedDataPath, config.DefaultSettingsSlotId, false); }
public StateManager(StateConfiguration config, EngineConfiguration engineConfig) { Configuration = config; var rollbackCapacity = (config.EnableStateRollback || Application.isEditor || Debug.isDebugBuild) ? Mathf.Max(1, config.StateRollbackSteps) : 1; // One step is reserved for game save operations. rollbackStack = new StateRollbackStack(rollbackCapacity); var savesFolderPath = PathUtils.Combine(engineConfig.GeneratedDataPath, config.SaveFolderName); GameStateSlotManager = (ISaveSlotManager <GameStateMap>)Activator.CreateInstance(Type.GetType(config.GameStateHandler), config, savesFolderPath); GlobalStateSlotManager = (ISaveSlotManager <GlobalStateMap>)Activator.CreateInstance(Type.GetType(config.GlobalStateHandler), config, savesFolderPath); SettingsSlotManager = (ISaveSlotManager <SettingsStateMap>)Activator.CreateInstance(Type.GetType(config.SettingsStateHandler), config, savesFolderPath); Engine.AddPostInitializationTask(InitializeStateAsync); }
public StateManager(StateConfiguration config, EngineConfiguration engineConfig) { Configuration = config; if (config.EnableStateRollback) { var rollbackCapacity = Mathf.Max(1, config.StateRollbackSteps); RollbackStack = new StateRollbackStack(rollbackCapacity); } var savesFolderPath = PathUtils.Combine(engineConfig.GeneratedDataPath, config.SaveFolderName); GameStateSlotManager = (ISaveSlotManager <GameStateMap>)Activator.CreateInstance(Type.GetType(config.GameStateHandler), config, savesFolderPath); GlobalStateSlotManager = (ISaveSlotManager <GlobalStateMap>)Activator.CreateInstance(Type.GetType(config.GlobalStateHandler), config, savesFolderPath); SettingsSlotManager = (ISaveSlotManager <SettingsStateMap>)Activator.CreateInstance(Type.GetType(config.SettingsStateHandler), config, savesFolderPath); }
public SettingsSlotManager(StateConfiguration config, string savesFolderPath) : base(savesFolderPath, false) { defaultSlotId = config.DefaultSettingsSlotId; }
public GameStateSlotManager(StateConfiguration config, string savesFolderPath) : base(savesFolderPath, config.BinarySaveFiles) { savePattern = string.Format(config.SaveSlotMask, "*") + $".{Extension}"; quickSavePattern = string.Format(config.QuickSaveSlotMask, "*") + $".{Extension}"; }
public IOSettingsSlotManager(StateConfiguration config, string savesFolderPath) { this.savesFolderPath = savesFolderPath; defaultSlotId = config.DefaultSettingsSlotId; }
public IOGlobalStateSlotManager(StateConfiguration config, string savesFolderPath) { this.savesFolderPath = savesFolderPath; this.config = config; defaultSlotId = config.DefaultGlobalSlotId; }
public GlobalStateSlotManager(StateConfiguration config, string savesFolderPath) : base(savesFolderPath, config.BinarySaveFiles) { defaultSlotId = config.DefaultGlobalSlotId; }