using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerInfo : MonoBehaviour
{

    [SerializeField]
    public GameObject PlayerAvatar;

    [SerializeField]
    public DrinkHolder drinkHolder = null;


    public bool CurrentlyHoldingADrink
    {
        get { return drinkHolder.CurrentlyHoldingADrink; }
    }

    public void SetHeldDrink(Drink drink)
    {
        drinkHolder.SetHeldDrink(drink);
    }

    public Drink ReleaseDrink()
    {
        Drink result = null;
        if (drinkHolder.CurrentlyHoldingADrink)
        {
            result = drinkHolder.GetHeldDrink();
            drinkHolder.ReleaseHeldDrink();
        }

        return result;
    }


    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        
    }

    public void SayDialogue(string dialogue)
    {
        FloatingText ft = PlayerAvatar.FloatText(dialogue);
        ft.TextSize = ft.TextSize / 2.0f;
        ft.gameObject.transform.position += new Vector3(0.0f, 0.8f, -0.1f);
        ft.Drift = new Vector3(0.0f, 0.1f, 0.0f);
    }
}
