Toast Engine
Loading...
Searching...
No Matches
hardness.hpp File Reference

Tiers of how hard a material is to break. More...

#include <array>
#include <cstdint>
#include <optional>
#include <string_view>
Include dependency graph for hardness.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum class  Hardness : uint8_t { soft , medium , hard }

Functions

constexpr auto physics::hardnessName (Hardness hardness) -> std::string_view
constexpr auto physics::hardnessFromName (std::string_view name) -> std::optional< Hardness >
constexpr auto physics::canBreak (Hardness max_hardness, Hardness material) -> bool

Variables

constexpr std::array< std::string_view, 3 > physics::k_hardness_names {"soft", "medium", "hard"}
constexpr Hardness physics::k_hardest = Hardness::hard

Detailed Description

Tiers of how hard a material is to break.

Author
Xein
Date
12 Oct 2026