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

public class CargoDetailsPanel : DetailsPanel
{
    public AttributePanel sterlings;
    public AttributePanel cargo;

    // Update is called once per frame
    void Update()
    {
        sterlings.SetValue(airship.sterlings.ToString());
        cargo.SetValue(airship.CurrentCargo().ToString() + "/" + airship.cargoCapacity.ToString() + " tonnes");
    }

    public void ClearContracts()
    {
        foreach (var detailPanel in GetComponentsInChildren<ContractPanel>())
        {
            Destroy(detailPanel.gameObject);
        }
    }

    public void AddContract(Contract contract)
    {
        var panel = Utils.PrefabbedComponent<ContractPanel>("_prefabs/ContractPanel");
        panel.contract = contract;
        panel.transform.SetParent(transform, false);
    }
}
