Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. *Read more...*

Feature #756123 ยป 0001-Introduce-action_get_activity.patch

Sveinung Kvilhaugsvik, 2018-05-28 11:37 AM

View differences:

common/actions.c
}
/**********************************************************************//**
Returns the unit activity this action may cause or ACTIVITY_LAST if the
action doesn't result in a unit activity.
**************************************************************************/
enum unit_activity action_get_activity(const struct action *paction)
{
fc_assert_msg(AAK_UNIT == action_get_actor_kind(paction),
"Action %s isn't performed by a unit",
action_rule_name(paction));
if (action_has_result(paction, ACTION_FORTIFY)) {
return ACTIVITY_FORTIFYING;
} else if (action_has_result(paction, ACTION_BASE)) {
return ACTIVITY_BASE;
} else if (action_has_result(paction, ACTION_ROAD)) {
return ACTIVITY_GEN_ROAD;
} else if (action_has_result(paction, ACTION_PILLAGE)) {
return ACTIVITY_PILLAGE;
} else if (action_has_result(paction, ACTION_TRANSFORM_TERRAIN)) {
return ACTIVITY_TRANSFORM;
} else if (action_has_result(paction, ACTION_CONVERT)) {
return ACTIVITY_CONVERT;
} else if (action_has_result(paction, ACTION_MINE_TF)
|| action_has_result(paction, ACTION_MINE)) {
return ACTIVITY_MINE;
} else if (action_has_result(paction, ACTION_IRRIGATE_TF)
|| action_has_result(paction, ACTION_IRRIGATE)) {
return ACTIVITY_IRRIGATE;
} else {
return ACTIVITY_LAST;
}
}
/**********************************************************************//**
Create a new action enabler.
**************************************************************************/
struct action_enabler *action_enabler_new(void)
common/actions.h
#define action_id_get_role(action_id) \
action_get_role(action_by_number(action_id))
enum unit_activity action_get_activity(const struct action *paction);
#define action_id_get_activity(action_id) \
action_get_activity(action_by_number(action_id))
const char *action_rule_name(const struct action *action);
const char *action_id_rule_name(int action_id);
    (1-1/1)