3#include "game/kart/KartParamFileManager.hh" 
    7KartParam::KartParam(Character character, Vehicle vehicle, u8 playerIdx) {
 
    8    initStats(character, vehicle);
 
   10    m_playerIdx = playerIdx;
 
   11    m_isBike = vehicle >= Vehicle::Standard_Bike_S;
 
   13        initBikeDispParams(vehicle);
 
   17KartParam::~KartParam() = 
default;
 
   20void KartParam::initStats(Character character, Vehicle vehicle) {
 
   21    auto *fileManager = KartParamFileManager::Instance();
 
   23    auto vehicleStream = fileManager->getVehicleStream(vehicle);
 
   24    auto driverStream = fileManager->getDriverStream(character);
 
   26    m_stats = Stats(vehicleStream);
 
   30void KartParam::initBikeDispParams(Vehicle vehicle) {
 
   31    auto *fileManager = KartParamFileManager::Instance();
 
   33    auto dispParamsStream = fileManager->getBikeDispParamsStream(vehicle);
 
   34    m_bikeDisp = BikeDisp(dispParamsStream);
 
   37void KartParam::initHitboxes(Vehicle vehicle) {
 
   38    auto *fileManager = KartParamFileManager::Instance();
 
   40    auto hitboxStream = fileManager->getHitboxStream(vehicle);
 
   41    m_bsp = BSP(hitboxStream);
 
   44KartParam::BikeDisp::BikeDisp() = 
default;
 
   52    m_handlePos.read(stream);
 
   53    m_handleRot.read(stream);
 
   56KartParam::Stats::Stats() = 
default;
 
   65    body = 
static_cast<Body>(stream.read_s32());
 
   66    driftType = 
static_cast<DriftType>(stream.read_s32());
 
   67    weightClass = 
static_cast<WeightClass
>(stream.read_s32());
 
   68    _00c = stream.read_f32();
 
   69    weight = stream.read_f32();
 
   70    bumpDeviationLevel = stream.read_f32();
 
   71    speed = stream.read_f32();
 
   72    turningSpeed = stream.read_f32();
 
   73    tilt = stream.read_f32();
 
   74    accelerationStandardA[0] = stream.read_f32();
 
   75    accelerationStandardA[1] = stream.read_f32();
 
   76    accelerationStandardA[2] = stream.read_f32();
 
   77    accelerationStandardA[3] = stream.read_f32();
 
   78    accelerationStandardT[0] = stream.read_f32();
 
   79    accelerationStandardT[1] = stream.read_f32();
 
   80    accelerationStandardT[2] = stream.read_f32();
 
   81    accelerationDriftA[0] = stream.read_f32();
 
   82    accelerationDriftA[1] = stream.read_f32();
 
   83    accelerationDriftT[0] = stream.read_f32();
 
   84    handlingManualTightness = stream.read_f32();
 
   85    handlingAutomaticTightness = stream.read_f32();
 
   86    handlingReactivity = stream.read_f32();
 
   87    driftManualTightness = stream.read_f32();
 
   88    driftAutomaticTightness = stream.read_f32();
 
   89    driftReactivity = stream.read_f32();
 
   90    driftOutsideTargetAngle = stream.read_f32();
 
   91    driftOutsideDecrement = stream.read_f32();
 
   92    miniTurbo = stream.read_u32();
 
   94    for (
size_t i = 0; i < kclSpeed.size(); ++i) {
 
   95        kclSpeed[i] = stream.read_f32();
 
   97    for (
size_t i = 0; i < kclRot.size(); ++i) {
 
   98        kclRot[i] = stream.read_f32();
 
  101    itemUnk170 = stream.read_f32();
 
  102    itemUnk174 = stream.read_f32();
 
  103    itemUnk178 = stream.read_f32();
 
  104    itemUnk17c = stream.read_f32();
 
  105    maxNormalAcceleration = stream.read_f32();
 
  106    megaScale = stream.read_f32();
 
  107    wheelDistance = stream.read_f32();
 
 
  114    weight += stream.read_f32();
 
  117    speed += stream.read_f32();
 
  118    turningSpeed += stream.read_f32();
 
  121    accelerationStandardA[0] += stream.read_f32();
 
  122    accelerationStandardA[1] += stream.read_f32();
 
  123    accelerationStandardA[2] += stream.read_f32();
 
  124    accelerationStandardA[3] += stream.read_f32();
 
  125    accelerationStandardA[0] += stream.read_f32();
 
  126    accelerationStandardA[1] += stream.read_f32();
 
  127    accelerationStandardA[2] += stream.read_f32();
 
  128    accelerationDriftA[0] += stream.read_f32();
 
  129    accelerationDriftA[1] += stream.read_f32();
 
  130    accelerationDriftT[0] += stream.read_f32();
 
  131    handlingManualTightness += stream.read_f32();
 
  132    handlingAutomaticTightness += stream.read_f32();
 
  133    handlingReactivity += stream.read_f32();
 
  134    driftManualTightness += stream.read_f32();
 
  135    driftAutomaticTightness += stream.read_f32();
 
  136    driftReactivity += stream.read_f32();
 
  137    driftOutsideTargetAngle += stream.read_f32();
 
  138    driftOutsideDecrement += stream.read_f32();
 
  139    miniTurbo += stream.read_u32();
 
  141    for (
size_t i = 0; i < kclSpeed.size(); ++i) {
 
  142        kclSpeed[i] += stream.read_f32();
 
  145    for (
size_t i = 0; i < kclRot.size(); ++i) {
 
  146        kclRot[i] += stream.read_f32();
 
 
  157    initialYPos = stream.read_f32();
 
  159    for (
auto &hitbox : hitboxes) {
 
  160        hitbox.enable = stream.read_u16();
 
  162        hitbox.position.read(stream);
 
  163        hitbox.radius = stream.read_f32();
 
  164        hitbox.wallsOnly = stream.read_u16();
 
  165        hitbox.tireCollisionIdx = stream.read_u16();
 
  168    cuboids[0].read(stream);
 
  169    cuboids[1].read(stream);
 
  170    angVel0Factor = stream.read_f32();
 
  171    _1a0 = stream.read_f32();
 
  173    for (
auto &wheel : wheels) {
 
  174        wheel.enable = stream.read_u16();
 
  176        wheel.springStiffness = stream.read_f32();
 
  177        wheel.dampingFactor = stream.read_f32();
 
  178        wheel.maxTravel = stream.read_f32();
 
  179        wheel.relPosition.read(stream);
 
  180        wheel.xRot = stream.read_f32();
 
  181        wheel.wheelRadius = stream.read_f32();
 
  182        wheel.sphereRadius = stream.read_f32();
 
  183        wheel._28 = stream.read_u32();
 
  186    rumbleHeight = stream.read_f32();
 
  187    rumbleSpeed = stream.read_f32();
 
A stream of data stored in memory.
Pertains to kart-related functionality.
void applyCharacterBonus(EGG::RamStream &stream)
Applies character stats on top of the kart stats.
DriftType
The type of drift (inside/outside).
void read(EGG::RamStream &stream)
Parses out the stats for a given KartParam.bin stream.
Body
The body style of the vehicle. Basically the number of wheels.