Rename affectedActionCategory to affectedActionTypeCategory in action timer API

develop
Tachytaenius 2022-12-01 23:19:10 +00:00
parent f06f17b59c
commit 76cdbfbc5c
2 changed files with 9 additions and 9 deletions

@ -227,11 +227,11 @@ DFHACK_EXPORT int getStressCategory(df::unit *unit);
DFHACK_EXPORT int getStressCategoryRaw(int32_t stress_level); DFHACK_EXPORT int getStressCategoryRaw(int32_t stress_level);
DFHACK_EXPORT void subtractActionTimers(color_ostream &out, df::unit *unit, int32_t amount, df::unit_action_type affectedActionType); DFHACK_EXPORT void subtractActionTimers(color_ostream &out, df::unit *unit, int32_t amount, df::unit_action_type affectedActionType);
DFHACK_EXPORT void subtractCategoryActionTimers(color_ostream &out, df::unit *unit, int32_t amount, df::unit_action_type_group affectedActionCategory); DFHACK_EXPORT void subtractCategoryActionTimers(color_ostream &out, df::unit *unit, int32_t amount, df::unit_action_type_group affectedActionTypeCategory);
DFHACK_EXPORT void multiplyActionTimers(color_ostream &out, df::unit *unit, float amount, df::unit_action_type affectedActionType); DFHACK_EXPORT void multiplyActionTimers(color_ostream &out, df::unit *unit, float amount, df::unit_action_type affectedActionType);
DFHACK_EXPORT void multiplyCategoryActionTimers(color_ostream &out, df::unit *unit, float amount, df::unit_action_type_group affectedActionCategory); DFHACK_EXPORT void multiplyCategoryActionTimers(color_ostream &out, df::unit *unit, float amount, df::unit_action_type_group affectedActionTypeCategory);
DFHACK_EXPORT void setActionTimers(color_ostream &out, df::unit *unit, int32_t amount, df::unit_action_type affectedActionType); DFHACK_EXPORT void setActionTimers(color_ostream &out, df::unit *unit, int32_t amount, df::unit_action_type affectedActionType);
DFHACK_EXPORT void setCategoryActionTimers(color_ostream &out, df::unit *unit, int32_t amount, df::unit_action_type_group affectedActionCategory); DFHACK_EXPORT void setCategoryActionTimers(color_ostream &out, df::unit *unit, int32_t amount, df::unit_action_type_group affectedActionTypeCategory);
} }
} }

@ -2032,13 +2032,13 @@ void Units::subtractActionTimers(color_ostream &out, df::unit *unit, int32_t amo
} }
} }
void Units::subtractCategoryActionTimers(color_ostream &out, df::unit *unit, int32_t amount, df::unit_action_type_group affectedActionCategory) void Units::subtractCategoryActionTimers(color_ostream &out, df::unit *unit, int32_t amount, df::unit_action_type_group affectedActionTypeCategory)
{ {
CHECK_NULL_POINTER(unit); CHECK_NULL_POINTER(unit);
for (auto action : unit->actions) { for (auto action : unit->actions) {
auto list = ENUM_ATTR(unit_action_type, group, action->type); auto list = ENUM_ATTR(unit_action_type, group, action->type);
for (size_t i = 0; i < list.size; i++) { for (size_t i = 0; i < list.size; i++) {
if (list.items[i] == affectedActionCategory) { if (list.items[i] == affectedActionTypeCategory) {
mutateActionTimerCore(action, [=](double timerValue){return max(timerValue - amount, 1.0);}); mutateActionTimerCore(action, [=](double timerValue){return max(timerValue - amount, 1.0);});
break; break;
} }
@ -2065,7 +2065,7 @@ void Units::multiplyActionTimers(color_ostream &out, df::unit *unit, float amoun
} }
} }
void Units::multiplyCategoryActionTimers(color_ostream &out, df::unit *unit, float amount, df::unit_action_type_group affectedActionCategory) void Units::multiplyCategoryActionTimers(color_ostream &out, df::unit *unit, float amount, df::unit_action_type_group affectedActionTypeCategory)
{ {
CHECK_NULL_POINTER(unit); CHECK_NULL_POINTER(unit);
if (!validateMultiplyActionTimerAmount(out, amount)) if (!validateMultiplyActionTimerAmount(out, amount))
@ -2073,7 +2073,7 @@ void Units::multiplyCategoryActionTimers(color_ostream &out, df::unit *unit, flo
for (auto action : unit->actions) { for (auto action : unit->actions) {
auto list = ENUM_ATTR(unit_action_type, group, action->type); auto list = ENUM_ATTR(unit_action_type, group, action->type);
for (size_t i = 0; i < list.size; i++) { for (size_t i = 0; i < list.size; i++) {
if (list.items[i] == affectedActionCategory) { if (list.items[i] == affectedActionTypeCategory) {
mutateActionTimerCore(action, [=](double timerValue){return max(timerValue * amount, 1.0);}); mutateActionTimerCore(action, [=](double timerValue){return max(timerValue * amount, 1.0);});
break; break;
} }
@ -2100,7 +2100,7 @@ void Units::setActionTimers(color_ostream &out, df::unit *unit, int32_t amount,
} }
} }
void Units::setCategoryActionTimers(color_ostream &out, df::unit *unit, int32_t amount, df::unit_action_type_group affectedActionCategory) void Units::setCategoryActionTimers(color_ostream &out, df::unit *unit, int32_t amount, df::unit_action_type_group affectedActionTypeCategory)
{ {
CHECK_NULL_POINTER(unit); CHECK_NULL_POINTER(unit);
if (!validateSetActionTimerAmount(out, amount)) if (!validateSetActionTimerAmount(out, amount))
@ -2108,7 +2108,7 @@ void Units::setCategoryActionTimers(color_ostream &out, df::unit *unit, int32_t
for (auto action : unit->actions) { for (auto action : unit->actions) {
auto list = ENUM_ATTR(unit_action_type, group, action->type); auto list = ENUM_ATTR(unit_action_type, group, action->type);
for (size_t i = 0; i < list.size; i++) { for (size_t i = 0; i < list.size; i++) {
if (list.items[i] == affectedActionCategory) { if (list.items[i] == affectedActionTypeCategory) {
mutateActionTimerCore(action, [=](double timerValue){return amount;}); mutateActionTimerCore(action, [=](double timerValue){return amount;});
break; break;
} }