package mae

// |@@| C

import (
	"context"
	"gardening/src/dat/maes"
	"gardening/src/lib/maestro"
	"gardening/src/mae/instruct_planner"
)

type InstructPlannerMae struct {
	Maestro     *maestro.Maestro
	PerformStep *steps.PerformStep
}

func (this *InstructPlannerMae) Act(ctx context.Context, in *maes.InstructPlannerMaeIn) (*maes.InstructPlannerMaeOut, error) {
	out := &maes.InstructPlannerMaeOut{In: in, Ctx: ctx}
	acts := []func(ctx context.Context, in *maes.InstructPlannerMaeIn, out *maes.InstructPlannerMaeOut) (bool, error){
		this.PerformStep.Act,
	}
	out, err := maestro.ActOnActs(ctx, in, out, acts)
	if err != nil {
		return out, err
	}
	out.Success = true
	return out, nil
}
