using UnityEngine;
using System.Collections;
using Framework.Entities;
using System.Collections.Generic;

public class TableResponsive : Responsive
{
    public class RecoveredAction : CoreAction
    {
    }

    protected override void InnerAwake()
    {
        base.InnerAwake();
        if (this.displayName == "")
        {
            this.displayName = "Alchemy Table";
        }
    }

    protected override void InnerUpdate()
    {

    }

    protected override void Respond(RespondAction action)
    {
        // Debug.Log(displayName + " responds. You are talking to them.");
        AlchemistBag bag = action.GetSender().GetGameObject().GetComponent<AlchemistBag>();
        if (bag != null)
        {
            List<string> results = bag.Craft();
            if(results.Count > 0)
                Announce(new Journal.AddEntryAction("It took some time, but I managed to craft the following: " + string.Join(", ", results.ToArray()) + "."));
        }
    }
}