Skip to content

Commit

Permalink
Refactored SceneEditorRepository into Datasource
Browse files Browse the repository at this point in the history
  • Loading branch information
Wavesonics committed Oct 25, 2024
1 parent d209513 commit c2e8c36
Show file tree
Hide file tree
Showing 16 changed files with 1,090 additions and 1,119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.darkrockstudios.apps.hammer.common.data.id.datasources

import com.darkrockstudios.apps.hammer.common.data.ProjectDef
import com.darkrockstudios.apps.hammer.common.data.sceneeditorrepository.SceneDatasource
import com.darkrockstudios.apps.hammer.common.data.sceneeditorrepository.SceneEditorRepository
import com.darkrockstudios.apps.hammer.common.data.sceneeditorrepository.filterScenePathsOkio
import com.darkrockstudios.apps.hammer.common.fileio.okio.toOkioPath
import okio.FileSystem
Expand All @@ -15,7 +14,7 @@ class SceneIdDatasource(

val maxId: Int = fileSystem.listRecursively(sceneDir)
.filterScenePathsOkio().maxOfOrNull { path ->
SceneEditorRepository.getSceneIdFromFilename(path.name)
SceneDatasource.getSceneIdFromFilename(path.name)
} ?: -1

return maxId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class ClientSceneSynchronizer(
order = serverEntity.order
)

val scenePath = sceneEditorRepository.getPathFromFilesystem(sceneItem)
val scenePath = sceneEditorRepository.resolveScenePathFromFilesystem(sceneItem.id)
?: throw IllegalStateException("Scene $id has no path")

val content = SceneContent(sceneItem, serverEntity.content)
Expand Down
Loading

0 comments on commit c2e8c36

Please sign in to comment.