Author: sveinung
Date: Mon Jun 27 12:22:47 2016
New Revision: 33063

URL: http://svn.gna.org/viewcvs/freeciv?rev=33063&view=rev
Log:
Init action probability values via functions.

This isolates them even more.

See patch #7315

Modified:
    trunk/common/actions.c
    trunk/common/actions.h

Modified: trunk/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=33063&r1=33062&r2=33063&view=diff
==============================================================================
--- trunk/common/actions.c      (original)
+++ trunk/common/actions.c      Mon Jun 27 12:22:47 2016
@@ -2714,6 +2714,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: trunk/common/actions.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.h?rev=33063&r1=33062&r2=33063&view=diff
==============================================================================
--- trunk/common/actions.h      (original)
+++ trunk/common/actions.h      Mon Jun 27 12:22:47 2016
@@ -375,12 +375,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()
 
 bool
 action_actor_utype_hard_reqs_ok(const enum gen_action wanted_action,


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to