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

public class HoldingStation : Station
{
    [SerializeField]
    public DrinkHolder drinkHolder = null;

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

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

    public override void InteractInitiated()
    {

    }

    public override void PlayerInteract()
    {
        PlayerInfo player = FindObjectOfType<PlayerInfo>();

        if (player.drinkHolder.CurrentlyHoldingADrink && !drinkHolder.CurrentlyHoldingADrink)
        {
            // Take the drink from the player
            Drink d = player.ReleaseDrink();
            drinkHolder.SetHeldDrink(d);
        }
        else if (!player.drinkHolder.CurrentlyHoldingADrink && drinkHolder.CurrentlyHoldingADrink)
        {
            // Pick up the drink from the machine
            Drink drink = drinkHolder.ReleaseHeldDrink();
            player.drinkHolder.SetHeldDrink(drink);
        }
    }

}
