private void LoadConfig() { var configuration = XSerializer.Load(@"Config.xml", true); if (configuration.IsPresent()) { mInstance = (GlobalVariablesInstance)configuration.Get(); } else { mInstance = new GlobalVariablesInstance(); } mInstance.LoadToStatic(); }
internal void ReloadContent(Director dir, Vector2 mapmeasurements, ContentManager content, GraphicsDeviceManager graphics) { GetGlobalVariablesInstance = new GlobalVariablesInstance(); GetGlobalVariablesInstance.UpdateFromStatic(); GetClock = dir.GetClock; GetIdGenerator = dir.GetIdGenerator; GetStoryManager = dir.GetStoryManager; GetMilitaryManager = dir.GetMilitaryManager; GetPathManager = dir.GetPathManager; GetUserInterfaceController = dir.GetUserInterfaceController; GetDistributionDirector = dir.GetDistributionDirector; GetDistributionDirector.ReloadContent(GetUserInterfaceController); GetStoryManager.LoadAchievements(); GetMilitaryManager.ReloadContent(mapmeasurements, this); GetStoryManager.ReloadContent(this); GetGraphicsDeviceManager = graphics; GetEventLog = new EventLog(GetUserInterfaceController, this, content); }
public Director(ContentManager content, GraphicsDeviceManager graphics, GlobalVariablesInstance globalVariablesInstance) { GetGlobalVariablesInstance = globalVariablesInstance; GetClock = new Clock(); GetIdGenerator = new IdGenerator(); GetSoundManager = new SoundManager(); GetInputManager = new InputManager(); GetStoryManager = new StoryManager(this); GetPathManager = new PathManager(); GetUserInterfaceController = new UserInterfaceController(this); GetDistributionDirector = new DistributionDirector(this); GetMilitaryManager = new MilitaryManager(this); GetActionManager = new ActionManager(); GetEventLog = new EventLog(GetUserInterfaceController, this, content); GetGraphicsDeviceManager = graphics; GetDeathManager = new DeathManager(); GetSoundManager.LoadContent(content); GetSoundManager.PlaySoundTrack(); GetStoryManager.LoadAchievements(); }