ASMR/src/main/kotlin/net/shadowfacts/asmr/program/Program.kt

22 lines
424 B
Kotlin

package net.shadowfacts.asmr.program
import net.shadowfacts.asmr.program.blocks.StartBlock
/**
* @author shadowfacts
*/
class Program {
var startBlock = StartBlock()
val blocks = mutableListOf<ProgramBlock>()
fun execute() {
var currentBlock: ExecutableBlock? = startBlock.nextExecutableBlock
while (currentBlock != null) {
currentBlock.execute()
currentBlock = currentBlock.nextExecutableBlock
}
}
}