A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/AlmasB/FXGL/commit/75fc7f152 below:

added EngineService onVarsInitialized() to notify services when… · AlmasB/FXGL@75fc7f1 · GitHub

File tree Expand file treeCollapse file tree 3 files changed

+12

-0

lines changed

Filter options

Expand file treeCollapse file tree 3 files changed

+12

-0

lines changed Original file line number Diff line number Diff line change

@@ -30,6 +30,12 @@ abstract class EngineService : Updatable, SerializableType {

30 30

*/

31 31

open fun onMainLoopStarting() { }

32 32 33 +

/**

34 +

* Called after initGameVars() is completed.

35 +

* This is called on a background thread.

36 +

*/

37 +

open fun onVarsInitialized(vars: PropertyMap) { }

38 + 33 39

/**

34 40

* Called when initGame(), initPhysics(), initUI() all completed and

35 41

* the game is ready to be played.

Original file line number Diff line number Diff line change

@@ -138,6 +138,10 @@ internal class Engine(val settings: ReadOnlyGameSettings) {

138 138

services.forEach { it.onGameUpdate(tpf) }

139 139

}

140 140 141 +

fun onVarsInitialized(vars: PropertyMap) {

142 +

services.forEach { it.onVarsInitialized(vars) }

143 +

}

144 + 141 145

fun onGameReady(vars: PropertyMap) {

142 146

services.forEach { it.onGameReady(vars) }

143 147

}

Original file line number Diff line number Diff line change

@@ -338,6 +338,8 @@ class FXGLApplication : Application() {

338 338

FXGL.getWorldProperties().setValue(name, value)

339 339

}

340 340 341 +

engine.onVarsInitialized(FXGL.getWorldProperties())

342 + 341 343

app.initGame();

342 344

}

343 345

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4