You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
628 B
Kotlin
22 lines
628 B
Kotlin
import com.last.commit.inventory.Inventory
|
|
import com.last.commit.config.GameSettings
|
|
import com.last.commit.config.GameConfig
|
|
import com.last.commit.audio.SoundEngine
|
|
import com.badlogic.gdx.Gdx
|
|
import com.badlogic.gdx.utils.Json
|
|
|
|
class GameState(
|
|
val inventory: Inventory,
|
|
val settings: GameSettings,
|
|
val soundEngine: SoundEngine,
|
|
) {
|
|
val gameConfig: GameConfig
|
|
get() = loadGameConfig()
|
|
|
|
fun loadGameConfig(): GameConfig {
|
|
val jsonFileHandle = Gdx.files.local("config.json")
|
|
val json = Json()
|
|
|
|
return json.fromJson(GameConfig::class.java, jsonFileHandle)
|
|
}
|
|
} |