namespace splat;

using Godot;

/// <summary>
/// Custom resource describing a vehicle's physical properties. Vehicles are
/// physics bodies (per the design pillar): mass, friction, and acceleration
/// drive real momentum, not scripted motion.
/// </summary>
[GlobalClass]
public partial class VehicleData : Resource
{
    public enum Kind
    {
        Car,
        Truck,
        Bus,
        Emergency
    }

    [Export] public string VehicleName { get; set; } = "Car";
    [Export] public Kind Type { get; set; } = Kind.Car;

    [Export] public float Mass { get; set; } = 1200f; // kg, typical car

    /// <summary>Tyre friction coefficient (affects braking/grip).</summary>
    [Export(PropertyHint.Range, "0,2,0.01")]
    public float Friction { get; set; } = 1.0f;

    /// <summary>Peak acceleration (m/s²) on pristine road.</summary>
    [Export] public float Acceleration { get; set; } = 4f;

    /// <Export>Peak braking deceleration (m/s²).</Export>
    [Export] public float Braking { get; set; } = 8f;

    /// <summary>Top speed (m/s) on pristine road.</summary>
    [Export] public float MaxSpeed { get; set; } = 14f;

    /// <summary>Colour used for the low-poly body (function-coded).</summary>
    [Export] public Color BodyColor { get; set; } = new Color(0.8f, 0.5f, 0.3f);
}
