package net.shadowfacts.asmr.program import net.minecraft.util.Identifier import net.minecraft.util.Language /** * @author shadowfacts */ class ProgramBlockOutput( val identifier: Identifier, val type: ProgramType, val block: ProgramBlock ) { lateinit var value: Type private val _destinations = mutableListOf>() val destinations: List> = _destinations fun link(to: ProgramBlockInput) { to.source = this _destinations.add(to) } fun unlink(to: ProgramBlockInput) { to.source = null _destinations.remove(to) } fun unlinkAll() { for (dest in destinations) { dest.source = null } _destinations.clear() } fun translateName(): String { return Language.getInstance().translate("programblock.param.${identifier.namespace}.${identifier.path}") } }