@@ -45,7 +45,7 @@ Will create a new global instance of a CruiseApp. Note that a program can only h
4545The next call to CruiseApp will return the same object.
4646"""
4747mutable struct CruiseApp
48- const plugins:: Dict{Symbol, CRPlugin}
48+ const plugins:: CRPlugin
4949 app:: ODApp
5050 render:: HorizonManager
5151 running:: Bool
@@ -61,8 +61,7 @@ function CruiseApp()
6161 global app_lock
6262 lock (app_lock)
6363 if ! isassigned (app)
64- app[] = CruiseApp (Dict {Symbol, CRPlugin} (:preupdate => CRPlugin (), :postupdate => CRPlugin ()),
65- ODApp (), HorizonManager (),false , false )
64+ app[] = CruiseApp (CRPlugin (), ODApp (), HorizonManager (),false , false )
6665 end
6766 unlock (app_lock)
6867 return app[]
@@ -93,10 +92,7 @@ Initialize all the systems in the given CRPlugin.
9392function awake! ()
9493 a = CruiseApp ()
9594 a. running = true
96- awake! (a. app)
97- for sg in values (a. plugins)
98- awake! (sg)
99- end
95+ awake! (a. plugins)
10096
10197 ON_CRUISE_STARTUP. emit
10298end
@@ -112,15 +108,7 @@ Update for the current frame the CruiseApp and all his plugins.
112108
113109Update for the current frame all the systems in the given CRPlugin.
114110"""
115- function update! ()
116- a = CruiseApp ()
117- update! (a. app)
118- for sg in values (a. plugins)
119- update! (sg)
120- end
121- update! (a. render)
122- end
123- update! (a:: CruiseApp , phase:: Symbol ) = update! (a. plugins[phase])
111+ update! () = update! (CruiseApp (). plugins)
124112update! (sg:: CRPlugin ) = pmap! (update!, sg)
125113update! (n:: CRPluginNode ) = nothing
126114
@@ -135,17 +123,13 @@ This will stop the given system graph by topologically calling shutdown! on the
135123"""
136124function shutdown! ()
137125 a = CruiseApp ()
138- shutdown! (a. app)
139- shutdown! (a. render)
140126 if on (a)
141127 a. running = false
142- for sg in values (a. plugins)
143- shutdown! (sg)
144- end
128+ shutdown! (a. plugins)
145129 end
146130end
147131shutdown! (sg:: CRPlugin ) = smap! (shutdown!, sg)
148- shutdown! (n:: CRPluginNode ) = (n. status[] = CRPluginStatus . OFF )
132+ shutdown! (n:: CRPluginNode ) = (n. status[] = PLUGIN_OFF )
149133
150134"""
151135 on(a::CruiseApp)
@@ -161,13 +145,9 @@ Returns true if the CruiseApp isn't running.
161145"""
162146off (a:: CruiseApp ) = ! a. running
163147
164- merge_plugin! (app:: CruiseApp , plugin:: CRPlugin , phase = :postupdate ) = merge_plugin! (app. plugins[phase] , plugin)
148+ merge_plugin! (app:: CruiseApp , plugin:: CRPlugin ) = merge_plugin! (app. plugins, plugin)
165149merge_plugin! (plugin1:: CRPlugin , plugin2:: CRPlugin ) = merge_graphs! (plugin1, plugin2)
166150
167- preupdate_plugins (a:: CruiseApp ) = a. plugins[:preupdate ]
168-
169- postupdate_plugins (a:: CruiseApp ) = a. plugins[:postupdate ]
170-
171151# ########################################################## OUTDOORS ################################################################
172152
173153function Outdoors. CreateWindow (style:: Type{<:AbstractStyle} , args... )
0 commit comments