using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;

public class TextPrices : MonoBehaviour
{
    [SerializeField] private SelectedPanel selectedPanel;
    [SerializeField] GameObject tile;
    [SerializeField] Text displayedText;

    void Update()
    {
        DisplayText();
    }

    void DisplayText()
    {
        string text;
        switch (selectedPanel)
        {
            case SelectedPanel.SCRAP:
                text = $"Scrap Machine\n{tile.GetComponent<Tile>().scrapScrapCost} scrap";
                break;
            case SelectedPanel.WATER:
                text = $"Water Extractor\n{tile.GetComponent<Tile>().waterScrapCost} scrap";
                break;
            case SelectedPanel.SOAP:
                text = $"Soap Machine\n{tile.GetComponent<Tile>().soapScrapCost} scrap";
                break;
            case SelectedPanel.MACHINE:
                text = $"Bubble Machine\n{tile.GetComponent<Tile>().machineScrapCost} scrap";
                break;
            case SelectedPanel.BARRAGE:
                text = $"Bubble Barrage\n{tile.GetComponent<Tile>().barrageScrapCost} scrap\n{tile.GetComponent<Tile>().barrageWaterCost} water";
                break;
            case SelectedPanel.BLAST:
                text = $"Bubble Blast\n{tile.GetComponent<Tile>().blastScrapCost} scrap\n{tile.GetComponent<Tile>().blastWaterCost} water\n{tile.GetComponent<Tile>().blastSoapCost} soap";
                break;
            case SelectedPanel.BATH:
                text = $"Bubble Bath\n{tile.GetComponent<Tile>().bathWaterCost} water\n{tile.GetComponent<Tile>().bathSoapCost} soap";
                break;
            default:
                text = $"none";
                break;
        }
        displayedText.text = text;
    }
    public enum SelectedPanel
    {
        SCRAP,
        WATER,
        SOAP,
        MACHINE,
        BARRAGE,
        BLAST,
        BATH
    }
}
