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

public class Contract : MonoBehaviour
{
    public int tonnage;
    public City origin;
    public City destination;
    public CargoType cargoType;
    public int value;
    public Airship airship;

    public bool loaded = false;
    
    public string DisplayName()
    {
        return "Alchemy Supplies";
    }

    public void Sell()
    {
        airship.Sell(this);
    }

    public void Load(Airship airship)
    {
        this.airship = airship;
        loaded = true;
    }

    public bool IsSellable()
    {
        return destination == airship.location;
    }

    public bool IsLoadable()
    {
        var ship = FindObjectOfType<Airship>();
        if (origin == ship.location)
        {
            return tonnage <= ship.AvailableCargo();
        } else
        {
            return false;
        }
    }
}
