Author: sveinung Date: Mon Jun 27 12:50:38 2016 New Revision: 33064 URL: http://svn.gna.org/viewcvs/freeciv?rev=33064&view=rev Log: Init action probability values via functions.
This isolates them even more. See patch #7315 Modified: branches/S2_6/common/actions.c branches/S2_6/common/actions.h Modified: branches/S2_6/common/actions.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/actions.c?rev=33064&r1=33063&r2=33064&view=diff ============================================================================== --- branches/S2_6/common/actions.c (original) +++ branches/S2_6/common/actions.c Mon Jun 27 12:50:38 2016 @@ -1294,6 +1294,38 @@ } /************************************************************************** + Returns the impossible action probability. +**************************************************************************/ +action_probability action_prob_new_impossible(void) +{ + return 0; +} + +/************************************************************************** + Returns the n/a action probability. +**************************************************************************/ +action_probability action_prob_new_not_relevant(void) +{ + return 253; +} + +/************************************************************************** + Returns the "not implemented" action probability. +**************************************************************************/ +action_probability action_prob_new_not_impl(void) +{ + return 254; +} + +/************************************************************************** + Returns the "user don't know" action probability. +**************************************************************************/ +action_probability action_prob_new_unknown(void) +{ + return 255; +} + +/************************************************************************** Returns TRUE iff the given action probability belongs to an action that may be possible. **************************************************************************/ Modified: branches/S2_6/common/actions.h URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/actions.h?rev=33064&r1=33063&r2=33064&view=diff ============================================================================== --- branches/S2_6/common/actions.h (original) +++ branches/S2_6/common/actions.h Mon Jun 27 12:50:38 2016 @@ -184,12 +184,17 @@ bool action_prob_possible(action_probability probability); +action_probability action_prob_new_impossible(void); +action_probability action_prob_new_not_relevant(void); +action_probability action_prob_new_not_impl(void); +action_probability action_prob_new_unknown(void); + /* Special action probability values. Documented in fc_types.h's * definition of action_probability. */ -#define ACTPROB_IMPOSSIBLE 0 -#define ACTPROB_NA 253 -#define ACTPROB_NOT_IMPLEMENTED 254 -#define ACTPROB_NOT_KNOWN 255 +#define ACTPROB_IMPOSSIBLE action_prob_new_impossible() +#define ACTPROB_NA action_prob_new_not_relevant() +#define ACTPROB_NOT_IMPLEMENTED action_prob_new_not_impl() +#define ACTPROB_NOT_KNOWN action_prob_new_unknown() /* Reasoning about actions */ bool action_immune_government(struct government *gov, int act); _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits