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

public class IcePlatformStation : 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 = GetComponent<PlayerInfo>();

        if (player.CurrentlyHoldingADrink && !drinkHolder.CurrentlyHoldingADrink)
        {
            Drink drink = player.ReleaseDrink();
            drinkHolder.SetHeldDrink(drink);
        }
        else if (drinkHolder.CurrentlyHoldingADrink && !player.CurrentlyHoldingADrink && !GetComponent<DispenseIceStation>().OperatingMachine)
        {
            // If the ice machine has a drink and the player doesn't, then the player can pick up the drink
            Drink drink = drinkHolder.ReleaseHeldDrink();
            player.SetHeldDrink(drink);
        }

    }

}
