mirror of
https://github.com/Theaninova/new-frontiers.git
synced 2025-12-12 11:36:16 +00:00
Resolve Cyclic Dependency
This commit is contained in:
@@ -4,29 +4,7 @@ import de.wulkanat.www.new_frontiers.blocks.BlockFTLDrive
|
|||||||
import de.wulkanat.www.new_frontiers.abstract_helpers.NFBlock
|
import de.wulkanat.www.new_frontiers.abstract_helpers.NFBlock
|
||||||
import de.wulkanat.www.new_frontiers.blocks.BlockSpaceTeleporter
|
import de.wulkanat.www.new_frontiers.blocks.BlockSpaceTeleporter
|
||||||
|
|
||||||
enum class Blocks(value: NFBlock) {
|
enum class Blocks(val value: NFBlock) {
|
||||||
SPACE_TELEPORTER(BlockSpaceTeleporter()),
|
SPACE_TELEPORTER(BlockSpaceTeleporter()),
|
||||||
FTL_DRIVE(BlockFTLDrive());
|
FTL_DRIVE(BlockFTLDrive());
|
||||||
|
|
||||||
val value: NFBlock by lazy {
|
|
||||||
value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class B(val a: String) {
|
|
||||||
init {
|
|
||||||
println("B Created")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class A(a: B) {
|
|
||||||
val b by lazy {
|
|
||||||
a
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun main() {
|
|
||||||
val a = A(B("something"))
|
|
||||||
|
|
||||||
println(a.b)
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user