Removed window as central storage, added Store class to be central memory store

This commit is contained in:
2021-11-22 20:38:24 -06:00
parent 3a269cbaae
commit a4dd375511
13 changed files with 109 additions and 85 deletions

View File

@@ -1,15 +1,12 @@
class W3DHub
class Window < CyberarmEngine::Window
attr_reader :settings, :application_manager
attr_accessor :account, :service_status, :applications
def setup
self.caption = I18n.t(:app_name)
@settings = Settings.new
@application_manager = ApplicationManager.new
Store[:settings] = Settings.new
Store[:application_manager] = ApplicationManager.new
@settings.save_settings
Store.settings.save_settings
push_state(W3DHub::States::Boot)
end
@@ -17,14 +14,14 @@ class W3DHub
def update
super
@application_manager.start_next_available_task if @application_manager.idle?
Store.application_manager.start_next_available_task if Store.application_manager.idle?
current_state.update_application_manager_status if current_state.is_a?(States::Interface)
end
def close
@settings.save_settings
Store.settings.save_settings
super if @application_manager.idle?
super if Store.application_manager.idle?
end
def main_thread_queue