package at.petrak.hexcasting.common.casting.operators.lists

import at.petrak.hexcasting.api.casting.castables.ConstMediaAction
import at.petrak.hexcasting.api.casting.asActionResult
import at.petrak.hexcasting.api.casting.eval.CastingEnvironment
import at.petrak.hexcasting.api.casting.getList
import at.petrak.hexcasting.api.casting.iota.Iota

object OpConcat : ConstMediaAction {
    override val argc = 2
    override fun execute(args: List<Iota>, ctx: CastingEnvironment): List<Iota> {
        val lhs = args.getList(0, argc).toMutableList()
        val rhs = args.getList(1, argc)
        lhs.addAll(rhs)
        return lhs.asActionResult
    }
}
