using Schema;
using UnityEngine;
using VOID.Generic.Objects.Unit;

namespace VOID.Generic.AI.Schema.Actions
{
    [Description("Gets this unit and save it as blackboard variable")]
    [Category(SchemaCategory.ThisUnit)]
    public class GetThisUnit : Action
    {
         [SerializeField, WriteOnly] public BlackboardEntrySelector<UnitObject> _saveTo;

        public override NodeStatus Tick(object nodeMemory, SchemaAgent agent)
        {
            _saveTo.value = ((UnitObjectSchemaAgent)agent).unit;
            return NodeStatus.Success;
        }
    }
}