#pragma once
#include "hce_tag_unit.h"
namespace HaloCE {
    enum TagVehicleType : uint16_t {
        TAG_VEHICLE_TYPE_HUMAN_TANK = 0,
        TAG_VEHICLE_TYPE_HUMAN_JEEP,
        TAG_VEHICLE_TYPE_HUMAN_BOAT,
        TAG_VEHICLE_TYPE_HUMAN_PLANE,
        TAG_VEHICLE_TYPE_ALIEN_SCOUT,
        TAG_VEHICLE_TYPE_ALIEN_FIGHTER,
        TAG_VEHICLE_TYPE_TURRET
    };

    enum TagVehicleFunction : uint16_t {
        TAG_VEHICLE_FUNCTION_NONE = 0,
        TAG_VEHICLE_FUNCTION_SPEED_ABSOLUTE,
        TAG_VEHICLE_FUNCTION_SPEWED_FORWARD,
        TAG_VEHICLE_FUNCTION_SPEED_BACKWARD,
        TAG_VEHICLE_FUNCTION_SLIDE_ABSOLUTE,
        TAG_VEHICLE_FUNCTION_SLIDE_LEFT,
        TAG_VEHICLE_FUNCTION_SLIDE_RIGHT,
        TAG_VEHICLE_FUNCTION_SPEED_SLIDE_MAXIMUM,
        TAG_VEHICLE_FUNCTION_TURN_ABSOLUTE,
        TAG_VEHICLE_FUNCTION_TURN_LEFT,
        TAG_VEHICLE_FUNCTION_TURN_RIGHT,
        TAG_VEHICLE_FUNCTION_CROUCH,
        TAG_VEHICLE_FUNCTION_JUMP,
        TAG_VEHICLE_FUNCTION_WALK,
        TAG_VEHICLE_FUNCTION_VELOCITY_AIR,
        TAG_VEHICLE_FUNCTION_VELOCITY_WATER,
        TAG_VEHICLE_FUNCTION_VELOCITY_GROUND,
        TAG_VEHICLE_FUNCTION_VELOCITY_FORWARD,
        TAG_VEHICLE_FUNCTION_VELOCITY_LEFT,
        TAG_VEHICLE_FUNCTION_VELOCITY_UP,
        TAG_VEHICLE_FUNCTION_LEFT_TREAD_POSITION,
        TAG_VEHICLE_FUNCTION_RIGHT_TREAD_POSITION,
        TAG_VEHICLE_FUNCTION_LEFT_TREAD_VELOCITY,
        TAG_VEHICLE_FUNCTION_RIGHT_TREAD_VELOCITY,
        TAG_VEHICLE_FUNCTION_FRONT_LEFT_TIRE_POSITION,
        TAG_VEHICLE_FUNCTION_FRONT_RIGHT_TIRE_POSITION,
        TAG_VEHICLE_FUNCTION_BACK_LEFT_TIRE_POSITION,
        TAG_VEHICLE_FUNCTION_BACK_RIGHT_TIRE_POSITION,
        TAG_VEHICLE_FUNCTION_FRONT_LEFT_TIRE_VELOCITY,
        TAG_VEHICLE_FUNCTION_FRONT_RIGHT_TIRE_VELOCITY,
        TAG_VEHICLE_FUNCTION_BACK_LEFT_TIRE_VELOCITY,
        TAG_VEHICLE_FUNCTION_BACK_RIGHT_TIRE_VELOCITY,
        TAG_VEHICLE_FUNCTION_WINGTIP_CONTRAIL,
        TAG_VEHICLE_FUNCTION_HOVER,
        TAG_VEHICLE_FUNCTION_THRUST,
        TAG_VEHICLE_FUNCTION_ENGINE_HACK,
        TAG_VEHICLE_FUNCTION_WINGTIP_CONTRAIL_NEW
    };

    struct TagVehicle : TagUnit {
        uint32_t speed_wakes_physics : 1;
        uint32_t turn_wakes_Physics : 1;
        uint32_t driver_power_wakes_physics : 1;
        uint32_t gunner_power_wakes_physics : 1;
        uint32_t control_opposite_speed_sets_brake : 1;
        uint32_t slide_wakes_physics : 1;
        uint32_t kill_riders_at_terminal_velocity : 1;
        uint32_t causes_collision_damage : 1;
        uint32_t ai_weapon_cannot_rotate : 1;
        uint32_t ai_does_not_require_driver : 1;
        uint32_t ai_unused : 1;
        uint32_t ai_driver_enable : 1;
        uint32_t ai_driver_flying : 1;
        uint32_t ai_driver_can_sidestep : 1;
        uint32_t ai_driver_hovering : 1;
        uint32_t unused1 : 17;
        TagVehicleType vehicle_type;
        float maximum_forward_speed;
        float maximum_reverse_speed;
        float speed_acceleration;
        float speed_deceleration;
        float maximum_left_turn;
        float maximum_right_turn;
        float wheel_circumference;
        float turn_rate;
        float blur_speed;
        TagVehicleFunction vehicle_a_in;
        TagVehicleFunction vehicle_b_in;
        TagVehicleFunction vehicle_c_in;
        TagVehicleFunction vehicle_d_in;
        char unknown1[0xC];
        float maximum_left_slide;
        float maximum_right_slide;
        float slide_acceleration;
        float slide_deceleration;
        float minimum_flipping_angular_velocity;
        float maximum_flipping_angular_velocity;
        char unknown2[0x18];
        float fixed_gun_yaw;
        float fixed_gun_pitch;
        char unknown3[0x18];

        struct {
            float sideslip_distance;
            float destination_radius;
            float avoidance_distance;
            float pathfinding_radius;
            float charge_repeat_timeout;
            float strafing_abort_range;
            float oversteering_bounds_from;
            float oversteering_bounds_to;
            float steering_maximum;
            float throttle_maximum;
            float move_position_time;
        } ai;

        char unknown4[0x4];
        /// (sound)
        Dependency suspension_sound;
        /// (sound)
        Dependency crash_sound;
        /// (material_effects)
        Dependency material_effects;
        /// (effect)
        Dependency effect;
    };
}
