using UnityEngine;

public class GrandmaAction
{
    public ActionAdvertiser advertiser;
    public float score;
    public Vector3? fixedTargetPosition; // Set ONLY if the action is an interactable
    public Sprite cachedIcon;
    public GrandmaAction(ActionAdvertiser adv, float score, Vector3? fixedPos = null)
    {
        advertiser = adv;
        this.score = score;
        this.fixedTargetPosition = fixedPos;
        cachedIcon = advertiser != null ? advertiser.icon : null;
    }
    
    public Vector3 GetTargetPosition()
    {
        if (fixedTargetPosition.HasValue)
            return fixedTargetPosition.Value;

        return advertiser.transform.position;
    }
}
