(PR#10239) production leader

"Mateusz Stefek" <mstefek-IjDXvh/[email protected]>
Newsgroups gmane.games.freeciv.ai
Message-ID <[email protected]>
<URL: http://rt.freeciv.org/Ticket/Display.html?id=10239 >

This patch adds production leader concept into AI code.
It is intended to be used in Appolo evaluation code.
--
mateusz
production_leader.diff (text/x-patch, 1.3 KB)
Index: aidata.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aidata.h,v
retrieving revision 1.17
diff -u -r1.17 aidata.h
--- aidata.h	13 Sep 2004 15:54:49 -0000	1.17
+++ aidata.h	21 Sep 2004 16:58:19 -0000
@@ -75,6 +75,7 @@
     int req_love_for_ceasefire;
     struct player *alliance_leader; /* Who is leading our alliance */
     struct player *spacerace_leader; /* who is leading the space pack */
+    struct player *production_leader;
   } diplomacy;
 
   /* Long-term threats, not to be confused with short-term danger */
Index: aidata.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aidata.c,v
retrieving revision 1.41
diff -u -r1.41 aidata.c
--- aidata.c	20 Sep 2004 20:05:50 -0000	1.41
+++ aidata.c	21 Sep 2004 16:58:20 -0000
@@ -347,6 +347,14 @@
     ai->diplomacy.alliance_leader = ally_strongest;
   }
   ai->diplomacy.spacerace_leader = player_leading_spacerace();
+  
+  ai->diplomacy.production_leader = NULL;
+  players_iterate(aplayer) {
+    if (ai->diplomacy.production_leader == NULL
+        || ai->diplomacy.production_leader->score.mfg < aplayer->score.mfg) {
+      ai->diplomacy.production_leader = aplayer;
+    }
+  } players_iterate_end;
 
   /*** Priorities ***/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.