ASMR/src/main/kotlin/net/shadowfacts/asmr/program/blocks/ConstantBlock.kt

27 lines
762 B
Kotlin
Raw Normal View History

2019-08-09 01:44:59 +00:00
package net.shadowfacts.asmr.program.blocks
2019-08-10 02:39:01 +00:00
import net.minecraft.util.Identifier
import net.shadowfacts.asmr.ASMR
2019-08-09 01:44:59 +00:00
import net.shadowfacts.asmr.program.ProgramBlock
import net.shadowfacts.asmr.program.ProgramBlockInput
import net.shadowfacts.asmr.program.ProgramBlockOutput
import net.shadowfacts.asmr.program.ProgramType
/**
* @author shadowfacts
*/
class ConstantBlock<Type: Any>(
val type: ProgramType<Type>,
val value: Type
2019-08-10 23:21:26 +00:00
): ProgramBlock(
Identifier(ASMR.modid, "constant")
) {
2019-08-09 01:44:59 +00:00
2019-08-10 23:21:26 +00:00
val output = ProgramBlockOutput(Identifier(ASMR.modid, "constant.output"), type, this).apply {
2019-08-09 01:44:59 +00:00
value = this@ConstantBlock.value
}
override val inputs: Array<ProgramBlockInput<*>> = arrayOf()
override val outputs: Array<ProgramBlockOutput<*>> = arrayOf(output)
}