@@ -22,83 +22,65 @@ import com.lambda.context.AutomatedSafeContext
2222import com.lambda.interaction.construction.processing.PreProcessingInfo
2323import com.lambda.interaction.construction.processing.ProcessorRegistry.getProcessingInfo
2424import com.lambda.interaction.construction.result.BuildResult
25- import com.lambda.interaction.construction.result.Dependable
26- import com.lambda.interaction.construction.simulation.checks.RequirementChecker.checkRequirements
25+ import com.lambda.interaction.construction.simulation.checks.BasicChecker.hasBasicRequirements
2726import com.lambda.interaction.construction.verify.TargetState
2827import net.minecraft.block.BlockState
2928import net.minecraft.util.math.BlockPos
3029import net.minecraft.util.math.Vec3d
3130import java.util.*
3231
33- @DslMarker
34- annotation class SimBuilderDsl
35-
3632interface ISimInfo : Automated {
3733 val pos: BlockPos
3834 val state: BlockState
3935 val targetState: TargetState
4036 val preProcessing: PreProcessingInfo
4137 val pov: Vec3d
4238 val concurrentResults: MutableSet <BuildResult >
43- val dependencyStack: Stack <Dependable >
39+ val dependencyStack: Stack <Sim < * > >
4440
4541 companion object {
46- @SimBuilderDsl
47- private suspend fun ISimInfo.sim (
48- dependable : Dependable ? ,
49- simBuilder : suspend context(Dependable ? ) SimBuilder .() -> Unit
50- ) = SimBuilder (this ).run { with (dependable) { simBuilder() } }
51-
52- @SimBuilderDsl
42+ @SimDsl
43+ context(_: BuildSimulator )
5344 suspend fun AutomatedSafeContext.sim (
5445 pos : BlockPos ,
5546 state : BlockState ,
5647 targetState : TargetState ,
5748 pov : Vec3d ,
5849 concurrentResults : MutableSet <BuildResult >,
59- simBuilder : suspend context( Dependable ? ) SimBuilder .() -> Unit
50+ simBuilder : suspend ISimInfo .() -> Unit
6051 ) {
6152 SimInfo (
6253 pos, state, targetState,
6354 targetState.getProcessingInfo(pos) ? : return ,
6455 pov, Stack (), concurrentResults, this
65- ).takeIf { it.checkRequirements () }?.sim( null , simBuilder)
56+ ).takeIf { it.hasBasicRequirements () }?.run { simBuilder() }
6657 }
6758
68- @SimBuilderDsl
69- context(_: AutomatedSafeContext , dependable : Dependable )
59+ @SimDsl
60+ context(_: AutomatedSafeContext , dependent : Sim < * > )
7061 suspend fun ISimInfo.sim (
7162 pos : BlockPos = this.pos,
7263 state : BlockState = this.state,
7364 targetState : TargetState = this.targetState,
7465 pov : Vec3d = this.pov,
75- simBuilder : suspend context( Dependable ? ) SimBuilder .() -> Unit
66+ simBuilder : suspend ISimInfo .() -> Unit
7667 ) {
7768 SimInfo (
7869 pos, state, targetState,
7970 targetState.getProcessingInfo(pos) ? : return ,
8071 pov, dependencyStack, concurrentResults, this
81- ).takeIf { it.checkRequirements () }?.sim(dependable, simBuilder)
72+ ).takeIf { it.hasBasicRequirements () }?.run { simBuilder() }
8273 }
83-
84- @SimBuilderDsl
85- context(dependable: Dependable )
86- suspend fun ISimInfo.sim (
87- simBuilder : suspend context(Dependable ? ) SimBuilder .() -> Unit
88- ) = sim(dependable, simBuilder)
8974 }
9075}
9176
92- @SimBuilderDsl
9377data class SimInfo (
9478 override val pos : BlockPos ,
9579 override val state : BlockState ,
9680 override val targetState : TargetState ,
9781 override val preProcessing : PreProcessingInfo ,
9882 override val pov : Vec3d ,
99- override val dependencyStack : Stack <Dependable >,
83+ override val dependencyStack : Stack <Sim < * > >,
10084 override val concurrentResults : MutableSet <BuildResult >,
10185 private val automated : Automated
102- ) : ISimInfo, Automated by automated
103-
104- class SimBuilder (simInfo : ISimInfo ) : ISimInfo by simInfo
86+ ) : ISimInfo, Automated by automated
0 commit comments