diff --git a/library/include/df/custom/.gitignore b/library/include/df/custom/.gitignore new file mode 100644 index 0000000000..96e79c167d --- /dev/null +++ b/library/include/df/custom/.gitignore @@ -0,0 +1 @@ +!*.h diff --git a/library/include/df/custom/hash/labor_kitchen_interface_food_key.h b/library/include/df/custom/hash/labor_kitchen_interface_food_key.h new file mode 100644 index 0000000000..3ca9676725 --- /dev/null +++ b/library/include/df/custom/hash/labor_kitchen_interface_food_key.h @@ -0,0 +1,16 @@ +template<> +struct std::hash { + auto operator()(const labor_kitchen_interface_food_key &a) const -> size_t { + struct thing { + int16_t t; + int16_t st; + int32_t x; + } thing{ + .t = a.type; + .st = a.subtype, + .x = static_cast(a.mat) ^ (static_cast(a.matg)) + }; + + return hash()(bit_cast(thing)); + } + }; diff --git a/library/include/df/custom/labor_kitchen_interface_food_key.custom.inc b/library/include/df/custom/labor_kitchen_interface_food_key.custom.inc new file mode 100644 index 0000000000..59796a69ba --- /dev/null +++ b/library/include/df/custom/labor_kitchen_interface_food_key.custom.inc @@ -0,0 +1,11 @@ + bool operator<(const labor_kitchen_interface_food_key &b) const { + if (type