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

public class CityDetailsPanel : DetailsPanel
{
    public TMP_Text cityName;
    public City city;
    public TMP_Text distance;
    public AirshipDetailsPanel airshipDetailsPanel;

    public void Activate(City newCity)
    {
        
        city = newCity;
        cityName.text = city.cityName;
        Activate();
    }

    public void Start()
    {

    }
    public void Update()
    {
        if (city == null)
        {
            Activate(GameManager.Instance().cities[16]);
        }
        distance.text = String.Format("{0,2:F1}", airship.DistanceTo(city)) + " Leagues";
    }

    public void Embark()
    {
        airshipDetailsPanel.Activate();
        airship.destination = city;
        airship.location = null;
    }

}
