namespace EDPlayerJournal.Entries;

public class DisembarkEntry : Entry {
    /// <summary>
    /// Disembarked into an SRV?
    /// </summary>
    public bool SRV { get; set; } = false;

    /// <summary>
    /// Taxi?
    /// </summary>
    public bool Taxi { get; set; } = false;

    /// <summary>
    /// Multicrew or not.
    /// </summary>
    public bool Multicrew { get; set; } = false;

    /// <summary>
    /// Player's ship ID
    /// </summary>
    public ulong? ID { get; set; }

    /// <summary>
    /// Star system
    /// </summary>
    public string? StarSystem { get; set; }

    /// <summary>
    /// System address
    /// </summary>
    public ulong? SystemAddress { get; set; }

    /// <summary>
    /// Body, name e.g. HIP 6182 B 2 a
    /// </summary>
    public string? Body { get; set; }

    /// <summary>
    /// Body ID
    /// </summary>
    public ulong? BodyID { get; set; }

    /// <summary>
    /// Disembarked on a station?
    /// </summary>
    public bool OnStation { get; set; } = false;

    /// <summary>
    /// Disembarked on a planet?
    /// </summary>
    public bool OnPlanet { get; set; } = false;

    protected override void Initialise() {
        SRV = JSON.Value<bool?>("SRV") ?? false;
        Taxi = JSON.Value<bool?>("Taxi") ?? false;
        Multicrew = JSON.Value<bool?>("Multicrew") ?? false;
        ID = JSON.Value<ulong?>("ID");
        StarSystem = JSON.Value<string?>("StarSystem");
        SystemAddress = JSON.Value<ulong?>("SystemAddress");
        Body = JSON.Value<string?>("Body");
        BodyID = JSON.Value<ulong?>("BodyID");
        OnStation = JSON.Value<bool?>("OnStation") ?? false;
        OnPlanet = JSON.Value<bool?>("OnPlanet") ?? false;
    }
}