16#include <unordered_map>
24 std::unordered_map<int, float>
times;
30 std::optional<float>
getTime(
int rating)
const {
31 auto i =
times.find(rating);
37 void toJson(Json::Value &
object)
const;
38 void fromJson(
const Json::Value &json);
42typedef std::unordered_map<std::string, struct ToolGroupCap>
ToolGCMap;
54 float full_punch_interval_ = 1.4f,
55 int max_drop_level_ = 1,
58 int punch_attack_uses_ = 0
67 void serialize(std::ostream &os, u16 version)
const;
117 DigParams(
bool a_diggable =
false,
float a_time = 0.0f, u32 a_wear = 0,
118 const std::string &a_main_group =
""):
128 const u16 initial_wear = 0);
144 u16 initial_wear = 0);
164 float time_from_last_punch,
std::unordered_map< std::string, int > ItemGroupList
Definition itemgroup.h:10
bool diggable
Definition tool.h:110
std::string main_group
Definition tool.h:115
float time
Definition tool.h:112
DigParams(bool a_diggable=false, float a_time=0.0f, u32 a_wear=0, const std::string &a_main_group="")
Definition tool.h:117
u32 wear
Definition tool.h:114
u32 wear
Definition tool.h:134
HitParams(s32 hp_=0, u32 wear_=0)
Definition tool.h:136
s32 hp
Definition tool.h:132
Definition inventory.h:19
bool did_punch
Definition tool.h:151
int wear
Definition tool.h:153
PunchDamageResult()=default
int damage
Definition tool.h:152
video::SColor getWearBarColor(f32 durabilityPercent)
Definition tool.cpp:275
void serialize(std::ostream &os) const
Definition tool.cpp:196
void serializeJson(std::ostream &os) const
Definition tool.cpp:230
constexpr static const EnumString es_BlendMode[3]
Definition tool.h:85
std::map< f32, video::SColor > colorStops
Definition tool.h:79
WearBarParams(const video::SColor color)
Definition tool.h:97
static std::optional< WearBarParams > deserializeJson(std::istream &is)
Definition tool.cpp:243
WearBarParams(const std::map< f32, video::SColor > &colorStops, BlendMode blend)
Definition tool.h:92
BlendMode
Definition tool.h:80
@ BLEND_MODE_CONSTANT
Definition tool.h:81
@ BlendMode_END
Definition tool.h:83
@ BLEND_MODE_LINEAR
Definition tool.h:82
static WearBarParams deserialize(std::istream &is)
Definition tool.cpp:207
BlendMode blend
Definition tool.h:90