#ifndef STEP_TYPE_H_38251870 #define STEP_TYPE_H_38251870 #include #include enum class StepType { none, wood, land_light, land, sand, water, mechanical, grass, unknown, paved, carpet, weak_wood, ladder_vine }; inline StepType stepTypeFromString(std::string_view str) { if (str == "wood") return StepType::wood; if (str == "land_light") return StepType::land_light; if (str == "land") return StepType::land; if (str == "sand") return StepType::sand; if (str == "water") return StepType::water; if (str == "mechanical") return StepType::mechanical; if (str == "grass") return StepType::grass; if (str == "unknown") return StepType::unknown; if (str == "paved") return StepType::paved; if (str == "carpet") return StepType::carpet; if (str == "weak_wood") return StepType::weak_wood; if (str == "ladder_vine") return StepType::ladder_vine; return StepType::none; } inline std::string_view runningSfxForStepType(StepType step) { switch (step) { case StepType::wood: return "../res/sfx/running_wood.wav"; case StepType::land_light: return "../res/sfx/running_land_light.wav"; case StepType::land: return "../res/sfx/running_land.wav"; case StepType::sand: return "../res/sfx/running_sand.wav"; case StepType::water: return "../res/sfx/running_water.wav"; case StepType::mechanical: return "../res/sfx/running_mechanical.wav"; case StepType::grass: return "../res/sfx/running_grass.wav"; case StepType::unknown: return "../res/sfx/running_unknown.wav"; case StepType::paved: return "../res/sfx/running_paved.wav"; case StepType::carpet: return "../res/sfx/running_carpet.wav"; case StepType::weak_wood: return "../res/sfx/running_weak_wood.wav"; case StepType::ladder_vine: return "../res/sfx/running_ladder_vine.wav"; case StepType::none: throw std::invalid_argument("No running sfx for none step type"); } } #endif /* end of include guard: STEP_TYPE_H_38251870 */