using System.Collections;
using UnityEngine;
using UnityEngine.Playables;

public class OldManCell : MonoBehaviour, IInteractable
{

    [SerializeField] private PlayableDirector director;
    public Dialogue dialogue;
    private string[] lines;
    private bool hasInteracted = false;
    [SerializeField] private GameObject table;


    public void Interact()
    {
        if(!hasInteracted)
        {
            hasInteracted = true;
            lines = new string[]{"Prisoner 784, time for us to search your cell before you get the ‘chair’.",
                            "You can follow me into the holding room over here.",
                            "Let me unlock that cell for you."};
            dialogue.StartDialogue(lines, "Officer", this.gameObject, "OpenCell");
        }
    }

    public void OpenCell()
    {
        director.Play();
        table.SendMessage("CellOpened");
    }

}
