[Editor] Fix circular dependencies
This commit is contained in:
@@ -6,6 +6,7 @@ import freemarker.template.Configuration
|
|||||||
import freemarker.template.TemplateExceptionHandler
|
import freemarker.template.TemplateExceptionHandler
|
||||||
import freemarker.template.Version
|
import freemarker.template.Version
|
||||||
import org.springframework.beans.factory.annotation.Autowired
|
import org.springframework.beans.factory.annotation.Autowired
|
||||||
|
import org.springframework.context.ApplicationContext
|
||||||
import org.springframework.stereotype.Component
|
import org.springframework.stereotype.Component
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
@@ -15,7 +16,11 @@ import java.util.*
|
|||||||
class JavaClassService {
|
class JavaClassService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private lateinit var projectContext: ProjectContext
|
private lateinit var appContext: ApplicationContext
|
||||||
|
|
||||||
|
private val projectContext: ProjectContext by lazy {
|
||||||
|
appContext.getBean(ProjectContext::class.java)
|
||||||
|
}
|
||||||
|
|
||||||
private val config = Configuration(Version(2, 3, 20)).apply {
|
private val config = Configuration(Version(2, 3, 20)).apply {
|
||||||
defaultEncoding = "UTF-8"
|
defaultEncoding = "UTF-8"
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import com.bartlomiejpluta.base.editor.tileset.model.Tile
|
|||||||
import com.bartlomiejpluta.base.editor.tileset.model.TileSet
|
import com.bartlomiejpluta.base.editor.tileset.model.TileSet
|
||||||
import com.bartlomiejpluta.base.proto.GameMapProto
|
import com.bartlomiejpluta.base.proto.GameMapProto
|
||||||
import org.springframework.beans.factory.annotation.Autowired
|
import org.springframework.beans.factory.annotation.Autowired
|
||||||
|
import org.springframework.context.ApplicationContext
|
||||||
import org.springframework.stereotype.Component
|
import org.springframework.stereotype.Component
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
|
|
||||||
@@ -17,7 +18,11 @@ import java.io.InputStream
|
|||||||
class ProtobufMapDeserializer : MapDeserializer {
|
class ProtobufMapDeserializer : MapDeserializer {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private lateinit var projectContext: ProjectContext
|
private lateinit var appContext: ApplicationContext
|
||||||
|
|
||||||
|
private val projectContext: ProjectContext by lazy {
|
||||||
|
appContext.getBean(ProjectContext::class.java)
|
||||||
|
}
|
||||||
|
|
||||||
override fun deserialize(input: InputStream): GameMap {
|
override fun deserialize(input: InputStream): GameMap {
|
||||||
val proto = GameMapProto.GameMap.parseFrom(input)
|
val proto = GameMapProto.GameMap.parseFrom(input)
|
||||||
|
|||||||
Reference in New Issue
Block a user