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 #875279

action: store action result in a separate field

Added by Sveinung Kvilhaugsvik about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Category:
General
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Fake generalized actions and actions with an escape and a non escape variant have the same result. All the differences between them are defined by hard coded action data and by the ruleset. Checking action result by action id for those means a lot of duplicate code.

Add the field result to the action struct and network packet. Its data type is currently gen_action. I plan to make the gen_action enum about action results as a part of the work on generalized actions.

Pick one gen_action value as the result number for each group of actions that shares the same result. Make ction_has_result() assert that the value checked for actually is a result.

Replace multiple calls to action_has_result() that checks for multiple actions that has the same result with a single call that checks for the result alone.

action_result.patch (51.7 KB) action_result.patch Sveinung Kvilhaugsvik, 2020-05-27 03:39 PM
0010-action-store-action-result-in-a-separate-field.patch (51.6 KB) 0010-action-store-action-result-in-a-separate-field.patch Sveinung Kvilhaugsvik, 2020-05-27 07:35 PM

Related issues

Related to Freeciv - Feature #849592: Separate action id from what an action doesNew

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Blocks Freeciv - Feature #875293: New utility action_by_result_iterate()Closed

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Blocks Freeciv - Feature #875306: Split action_result enum from gen_actionClosed

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by Sveinung Kvilhaugsvik about 2 years ago

  • Related to Feature #849592: Separate action id from what an action does added

#2 Updated by Sveinung Kvilhaugsvik about 2 years ago

#3 Updated by Sveinung Kvilhaugsvik about 2 years ago

#4 Updated by Sveinung Kvilhaugsvik about 2 years ago

v2: Remove TODO comment. Things may move along faster than expected.

#5 Updated by Sveinung Kvilhaugsvik about 2 years ago

#6 Updated by Sveinung Kvilhaugsvik about 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF