Freeciv-3.3
|
#include "mem.h"
#include "actres.h"
#include "nation.h"
#include "player.h"
#include "oblig_reqs.h"
Go to the source code of this file.
Functions | |
static struct ae_contra_or * | req_contradiction_or (int alternatives,...) |
static void | ae_contra_close (struct ae_contra_or *contra) |
static void | voblig_hard_req_reg_sub_res (struct ae_contra_or *contras, const char *error_message, va_list args) |
static void | oblig_hard_req_reg_sub_res (struct ae_contra_or *contras, const char *error_message,...) |
static void | voblig_hard_req_reg (struct ae_contra_or *contras, const char *error_message, va_list args) |
static void | oblig_hard_req_reg (struct ae_contra_or *contras, const char *error_message,...) |
static void | oblig_hard_req_register (struct requirement contradiction, bool is_target, const char *error_message,...) |
void | hard_code_oblig_hard_reqs (void) |
void | hard_code_oblig_hard_reqs_ruleset (void) |
void | oblig_hard_reqs_init (void) |
void | oblig_hard_reqs_free (void) |
struct obligatory_req_vector * | oblig_hard_reqs_get (enum action_result res) |
struct obligatory_req_vector * | oblig_hard_reqs_get_sub (enum action_sub_result res) |
Variables | |
static struct obligatory_req_vector | oblig_hard_reqs_r [ACTRES_NONE] |
static struct obligatory_req_vector | oblig_hard_reqs_sr [ACT_SUB_RES_COUNT] |
|
static |
Tell an ae_contra_or that one of its users is done with it.
contra | the ae_contra_or the user is done with. |
Definition at line 76 of file oblig_reqs.c.
Referenced by oblig_hard_reqs_free().
Hard code the obligatory hard requirements that don't depend on the rest of the ruleset. They are sorted by requirement to make it easy to read, modify and explain them.
Definition at line 250 of file oblig_reqs.c.
Referenced by actions_init().
Hard code the obligatory hard requirements that needs access to the ruleset before they can be generated.
Definition at line 770 of file oblig_reqs.c.
Referenced by actions_rs_pre_san_gen().
|
static |
Register an obligatory hard requirement for the specified action results.
contras | if one alternative here doesn't contradict the enabler it is accepted. |
error_message | error message if an enabler contradicts all contras. Followed by a list of action results that should be unable to contradict all specified contradictions. |
Definition at line 207 of file oblig_reqs.c.
Referenced by hard_code_oblig_hard_reqs(), and hard_code_oblig_hard_reqs_ruleset().
|
static |
Register an obligatory hard requirement for the specified action sub results.
contras | if one alternative here doesn't contradict the enabler it is accepted. |
error_message | error message if an enabler contradicts all contras. Followed by a list of action sub results that should be unable to contradict all specified contradictions. |
Definition at line 140 of file oblig_reqs.c.
Referenced by hard_code_oblig_hard_reqs().
|
static |
Register an obligatory hard requirement for the action results it applies to.
The vararg parameter is a list of action ids it applies to terminated by ACTION_NONE.
Definition at line 227 of file oblig_reqs.c.
Referenced by hard_code_oblig_hard_reqs(), and hard_code_oblig_hard_reqs_ruleset().
Free resources reserved for hard reqs system.
Definition at line 827 of file oblig_reqs.c.
Referenced by actions_free().
struct obligatory_req_vector * oblig_hard_reqs_get | ( | enum action_result | res | ) |
Get obligatory requirements for action result.
res | Action result to get requirements for |
Definition at line 852 of file oblig_reqs.c.
Referenced by action_enabler_suggest_repair_oblig().
struct obligatory_req_vector * oblig_hard_reqs_get_sub | ( | enum action_sub_result | res | ) |
Get obligatory requirements for action with sub result.
res | Action sub result to get requirements for |
Definition at line 863 of file oblig_reqs.c.
Referenced by action_enabler_suggest_repair_oblig().
Initialize hard reqs system.
Definition at line 807 of file oblig_reqs.c.
Referenced by actions_init().
|
static |
Returns a new array of alternative action enabler contradictions. Only one has to not contradict the enabler for it to be seen as fulfilled.
alternatives | the number of action enabler contradictions followed by the enabler contradictions specified as alternating contradicting requirement and a bool that is TRUE if the requirement contradicts the enabler's target requirement vector and FALSE if it contradicts the enabler's actor vector. |
Definition at line 46 of file oblig_reqs.c.
Referenced by hard_code_oblig_hard_reqs(), hard_code_oblig_hard_reqs_ruleset(), and oblig_hard_req_register().
|
static |
Register an obligatory hard requirement for the specified action results.
contras | if one alternative here doesn't contradict the enabler it is accepted. |
error_message | error message if an enabler contradicts all contras. |
args | list of action results that should be unable to contradict all specified contradictions. |
Definition at line 162 of file oblig_reqs.c.
Referenced by oblig_hard_req_reg(), and oblig_hard_req_register().
|
static |
Register an obligatory hard requirement for the specified action sub results.
contras | if one alternative here doesn't contradict the enabler it is accepted. |
error_message | error message if an enabler contradicts all contras. |
args | list of action sub results that should be unable to contradict all specified contradictions. |
Definition at line 97 of file oblig_reqs.c.
Referenced by oblig_hard_req_reg_sub_res().
|
static |
Definition at line 30 of file oblig_reqs.c.
Referenced by oblig_hard_reqs_free(), oblig_hard_reqs_get(), oblig_hard_reqs_init(), and voblig_hard_req_reg().
|
static |
Definition at line 31 of file oblig_reqs.c.
Referenced by oblig_hard_reqs_free(), oblig_hard_reqs_get_sub(), oblig_hard_reqs_init(), and voblig_hard_req_reg_sub_res().