A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
Common.hh File Reference

Detailed Description

This header houses common data types such as our integral types and enums.

Definition in file Common.hh.

Go to the source code of this file.

Classes

struct  is_derived_from_template< Base, Derived >
 Helper template which uses function overloading and implict up-casting to determine whether or not a class is derived from a templated base class (i.e. MapdataPointInfoAccessor derives from MapdataAccessorBase). See: https://en.cppreference.com/w/cpp/language/sfinae. More...
 

Concepts

concept  IntegralType
 
concept  ParseableType
 

Enumerations

enum class  Course {
  Mario_Circuit = 0 ,
  Moo_Moo_Meadows = 1 ,
  Mushroom_Gorge = 2 ,
  Grumble_Volcano = 3 ,
  Toads_Factory = 4 ,
  Coconut_Mall = 5 ,
  DK_Summit = 6 ,
  Wario_Gold_Mine = 7 ,
  Luigi_Circuit = 8 ,
  Daisy_Circuit = 9 ,
  Moonview_Highway = 10 ,
  Maple_Treeway = 11 ,
  Bowsers_Castle = 12 ,
  Rainbow_Road = 13 ,
  Dry_Dry_Ruins = 14 ,
  Koopa_Cape = 15 ,
  GCN_Peach_Beach = 16 ,
  GCN_Mario_Circuit = 17 ,
  GCN_Waluigi_Stadium = 18 ,
  GCN_DK_Mountain = 19 ,
  DS_Yoshi_Falls = 20 ,
  DS_Desert_Hills = 21 ,
  DS_Peach_Gardens = 22 ,
  DS_Delfino_Square = 23 ,
  SNES_Mario_Circuit_3 = 24 ,
  SNES_Ghost_Valley_2 = 25 ,
  N64_Mario_Raceway = 26 ,
  N64_Sherbet_Land = 27 ,
  N64_Bowsers_Castle = 28 ,
  N64_DKs_Jungle_Parkway = 29 ,
  GBA_Bowser_Castle_3 = 30 ,
  GBA_Shy_Guy_Beach = 31 ,
  Delfino_Pier = 32 ,
  Block_Plaza = 33 ,
  Chain_Chomp_Roulette = 34 ,
  Funky_Stadium = 35 ,
  Thwomp_Desert = 36 ,
  GCN_Cookie_Land = 37 ,
  DS_Twilight_House = 38 ,
  SNES_Battle_Course_4 = 39 ,
  GBA_Battle_Course_3 = 40 ,
  N64_Skyscraper = 41 ,
  Galaxy_Colosseum = 54 ,
  Win_Demo = 55 ,
  Lose_Demo = 56 ,
  Draw_Demo = 57 ,
  Ending_Demo = 58
}
 
enum class  Vehicle {
  Standard_Kart_S = 0 ,
  Standard_Kart_M = 1 ,
  Standard_Kart_L = 2 ,
  Baby_Booster = 3 ,
  Classic_Dragster = 4 ,
  Offroader = 5 ,
  Mini_Beast = 6 ,
  Wild_Wing = 7 ,
  Flame_Flyer = 8 ,
  Cheep_Charger = 9 ,
  Super_Blooper = 10 ,
  Piranha_Prowler = 11 ,
  Tiny_Titan = 12 ,
  Daytripper = 13 ,
  Jetsetter = 14 ,
  Blue_Falcon = 15 ,
  Sprinter = 16 ,
  Honeycoupe = 17 ,
  Standard_Bike_S = 18 ,
  Standard_Bike_M = 19 ,
  Standard_Bike_L = 20 ,
  Bullet_Bike = 21 ,
  Mach_Bike = 22 ,
  Flame_Runner = 23 ,
  Bit_Bike = 24 ,
  Sugarscoot = 25 ,
  Wario_Bike = 26 ,
  Quacker = 27 ,
  Zip_Zip = 28 ,
  Shooting_Star = 29 ,
  Magikruiser = 30 ,
  Sneakster = 31 ,
  Spear = 32 ,
  Jet_Bubble = 33 ,
  Dolphin_Dasher = 34 ,
  Phantom = 35 ,
  Max = 36
}
 
enum class  Character {
  Mario = 0 ,
  Baby_Peach = 1 ,
  Waluigi = 2 ,
  Bowser = 3 ,
  Baby_Daisy = 4 ,
  Dry_Bones = 5 ,
  Baby_Mario = 6 ,
  Luigi = 7 ,
  Toad = 8 ,
  Donkey_Kong = 9 ,
  Yoshi = 10 ,
  Wario = 11 ,
  Baby_Luigi = 12 ,
  Toadette = 13 ,
  Koopa_Troopa = 14 ,
  Daisy = 15 ,
  Peach = 16 ,
  Birdo = 17 ,
  Diddy_Kong = 18 ,
  King_Boo = 19 ,
  Bowser_Jr = 20 ,
  Dry_Bowser = 21 ,
  Funky_Kong = 22 ,
  Rosalina = 23 ,
  Small_Mii_Outfit_A_Male = 24 ,
  Small_Mii_Outfit_A_Female = 25 ,
  Small_Mii_Outfit_B_Male = 26 ,
  Small_Mii_Outfit_B_Female = 27 ,
  Small_Mii_Outfit_C_Male = 28 ,
  Small_Mii_Outfit_C_Female = 29 ,
  Medium_Mii_Outfit_A_Male = 30 ,
  Medium_Mii_Outfit_A_Female = 31 ,
  Medium_Mii_Outfit_B_Male = 32 ,
  Medium_Mii_Outfit_B_Female = 33 ,
  Medium_Mii_Outfit_C_Male = 34 ,
  Medium_Mii_Outfit_C_Female = 35 ,
  Large_Mii_Outfit_A_Male = 36 ,
  Large_Mii_Outfit_A_Female = 37 ,
  Large_Mii_Outfit_B_Male = 38 ,
  Large_Mii_Outfit_B_Female = 39 ,
  Large_Mii_Outfit_C_Male = 40 ,
  Large_Mii_Outfit_C_Female = 41 ,
  Medium_Mii = 42 ,
  Small_Mii = 43 ,
  Large_Mii = 44 ,
  Peach_Biker_Outfit = 45 ,
  Daisy_Biker_Outfit = 46 ,
  Rosalina_Biker_Outfit = 47 ,
  Max = 48
}
 
enum class  WeightClass {
  Invalid = -1 ,
  Light = 0 ,
  Medium = 1 ,
  Heavy = 2
}
 
enum class  GroupID : u16 {
  None = 0 ,
  Race = 1 ,
  Gfx = 2 ,
  Kart = 3 ,
  Object = 4 ,
  Course = 5 ,
  UI = 6 ,
  Effect = 7 ,
  Sound = 8 ,
  Resource = 10 ,
  HomeMenu = 11 ,
  Item = 12 ,
  Net = 13
}
 

Functions

static constexpr WeightClass CharacterToWeight (Character character)
 
static constexpr WeightClass VehicleToWeight (Vehicle vehicle)
 
 STATIC_ASSERT (std::numeric_limits< f32 >::epsilon()==1.0f/8388608.0f)
 
 STATIC_ASSERT (std::endian::native==std::endian::big||std::endian::native==std::endian::little)
 
template<IntegralType T>
static T form (const u8 *data)
 
template<ParseableType T>
static constexpr T parse (T val, std::endian endian=std::endian::big)
 
static constexpr u32 f2u (f32 val)
 

Variables

static constexpr const char * COURSE_NAMES [59]
 
static constexpr const char * VEHICLE_NAMES [36]
 
template<template< typename... > class Base, typename Derived >
constexpr bool is_derived_from_template_v = is_derived_from_template<Base, Derived>::value
 

Enumeration Type Documentation

◆ Character

enum class Character
strong

Definition at line 119 of file Common.hh.

◆ Course

enum class Course
strong

Definition at line 29 of file Common.hh.

◆ GroupID

enum class GroupID : u16
strong

Definition at line 178 of file Common.hh.

◆ Vehicle

enum class Vehicle
strong

Definition at line 79 of file Common.hh.

◆ WeightClass

enum class WeightClass
strong

Definition at line 171 of file Common.hh.

Function Documentation

◆ CharacterToWeight()

static constexpr WeightClass CharacterToWeight ( Character character)
staticconstexpr

Definition at line 194 of file Common.hh.

◆ f2u()

static constexpr u32 f2u ( f32 val)
inlinestaticconstexpr

Definition at line 429 of file Common.hh.

◆ form()

template<IntegralType T>
static T form ( const u8 * data)
inlinestatic

Definition at line 406 of file Common.hh.

◆ parse()

template<ParseableType T>
static constexpr T parse ( T val,
std::endian endian = std::endian::big )
inlinestaticconstexpr

Definition at line 416 of file Common.hh.

◆ VehicleToWeight()

static constexpr WeightClass VehicleToWeight ( Vehicle vehicle)
staticconstexpr

Definition at line 228 of file Common.hh.

Variable Documentation

◆ COURSE_NAMES

const char* COURSE_NAMES[59]
staticconstexpr

Definition at line 274 of file Common.hh.

◆ is_derived_from_template_v

template<template< typename... > class Base, typename Derived >
bool is_derived_from_template_v = is_derived_from_template<Base, Derived>::value
inlineconstexpr

Definition at line 395 of file Common.hh.

◆ VEHICLE_NAMES

const char* VEHICLE_NAMES[36]
staticconstexpr

Definition at line 336 of file Common.hh.