Rename affectedActionTypeCategory to affectedActionTypeGroup in action timer API

develop
Tachytaenius 2022-12-01 23:22:02 +00:00
parent 76cdbfbc5c
commit ae532e1452
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 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 affectedActionTypeCategory);
DFHACK_EXPORT void subtractCategoryActionTimers(color_ostream &out, df::unit *unit, int32_t amount, df::unit_action_type_group affectedActionTypeGroup);
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 affectedActionTypeCategory);
DFHACK_EXPORT void multiplyCategoryActionTimers(color_ostream &out, df::unit *unit, float amount, df::unit_action_type_group affectedActionTypeGroup);
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 affectedActionTypeCategory);
DFHACK_EXPORT void setCategoryActionTimers(color_ostream &out, df::unit *unit, int32_t amount, df::unit_action_type_group affectedActionTypeGroup);
}
}

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