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

public class AirshipDetailsPanel : DetailsPanel
{
    public AttributePanel sterlings;
    public AttributePanel fuel;
    public AttributePanel location;
    public AttributePanel destination;
    public AttributePanel speed;
    public AttributePanel cargo;

    // Update is called once per frame
    void Update()
    {
        sterlings.SetValue(airship.sterlings.ToString());
        fuel.SetValue(airship.CurrentFuel().ToString() + "/" + airship.maxFuel.ToString() + " tonnes");
        location.SetValue(LocationString());
        destination.SetValue(DestinationString());
        cargo.SetValue(airship.CurrentCargo().ToString() + "/" + airship.cargoCapacity.ToString() + " tonnes");
        speed.SetValue(airship.Speed().ToString());
    }

    string LocationString()
    {
        if (airship.location != null)
        {
            return airship.location.cityName;
        } else
        {
            return "in the Clouds";
        }

    }

    string DestinationString()
    {
        if (airship.destination != null)
        {
            return airship.destination.cityName;
        } else
        {
            return "- none -";
        }
    }
}
