public DungeonsController(IDungeonsService dungeonsService, IZoneService zoneService, IPlayerService playerService, IWebBrowserController browserController, DungeonsUserData userData) { logger.Debug("Initializing Dungeons Controller"); this.dungeonsService = dungeonsService; this.zoneService = zoneService; this.playerService = playerService; this.browserController = browserController; this.userData = userData; this.isStopped = false; this.tickStopped = false; this.currentRunTimeSaved = false; // Initialize the dungeon timer view model this.DungeonTimerData = new DungeonTimerViewModel(userData); // Initialize the refresh timer this.dungeonsRefreshTimer = new Timer(this.Refresh); this.RefreshInterval = 250; // Initialize the start call count to 0 this.startCallCount = 0; // Initialize the dungeons this.InitializeDungeons(); // This takes a while, so do it on a background thread Task.Factory.StartNew(() => { this.InitializeDungeonZoneNames(); }); logger.Info("Dungeons Controller initialized"); }
/// <summary> /// Performs all neccesary shutdown activities for this module /// </summary> private void Shutdown() { logger.Debug("Shutting down Dungeons Module"); // Shut down the commerce controller this.dungeonsController.Shutdown(); // Shutdown the view controller this.viewController.Shutdown(); // Make sure we have saved all user data // Note that this is a little redundant given the AutoSave feature, // but it does help to make sure the user's data is really saved DungeonsUserData.SaveData(this.UserData, DungeonsUserData.Filename); }