mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-05 07:49:17 +07:00
Use kotlin coroutines instead of raw threads (+ refactorings) (#6801)
* Refactor: Move classes into their own files * Handle 404 FileNotFound in UncivServer * Refactor: Rename method * Make GameSaver.saveGame throw the exception by default if it is not handled * Add possibility to work with FileHandles in GameSaver * Make OnlineMultiplayerGameSaver load the multiplayerServer setting each time it does something This theoretically makes it unnecessary for the OnlineMultiplayerGameSaver to be re-instantiated each time it is used * Refactor: Remove duplicated code * Refactor: Extract NextTurnButton from WorldScreen * Refactor: Remove WorldScreen-specific code from OptionsPopup * Use kotlin coroutines everywhere instead of plain threads This probably also cuts down on our raw thread usage, improving performance, since we now use a cached thread pool (in addition to coroutines being able to reuse threads anyway) * Improve deep load from notification * Refactor: Give music download coroutine the proper name
This commit is contained in:
@ -93,6 +93,7 @@ project(":android") {
|
||||
dependencies {
|
||||
"implementation"(project(":core"))
|
||||
"implementation"("com.badlogicgames.gdx:gdx-backend-android:$gdxVersion")
|
||||
"implementation"("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1")
|
||||
natives("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a")
|
||||
natives("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a")
|
||||
natives("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86")
|
||||
@ -119,6 +120,7 @@ project(":core") {
|
||||
|
||||
dependencies {
|
||||
"implementation"("com.badlogicgames.gdx:gdx:$gdxVersion")
|
||||
"implementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1")
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user