From f0bbfee11a0418064a142101a952c3043dde7351 Mon Sep 17 00:00:00 2001 From: Nathan Vance Date: Sat, 28 Feb 2015 23:21:31 -0500 Subject: Started work on ai --- data.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'data.c') diff --git a/data.c b/data.c index 75df70b..2763cb8 100644 --- a/data.c +++ b/data.c @@ -128,7 +128,8 @@ int data_getwest(int p) int data_getdir(int dir, int p) { if(dir == 0) return data_geteast(p); - return data_getwest(p); + if(dir == 1) return data_getwest(p); + return p; } int* data_gethand(int p) @@ -411,3 +412,15 @@ int data_gettotvps(int p) tot += science(p); return tot; } + +int data_potentialvps(int p, int era, int card) +{ + int i; + for(i = 0; player[p][era][i] != -1; i++); //get free spot in array + player[p][era][i] = card; //build card + player[i][3][3] += cards_getproduction(era, card)[GOLD]; + int vps = data_gettotvps(p); + player[p][era][i] = -1; + player[i][3][3] -= cards_getproduction(era, card)[GOLD]; + return vps; +} -- cgit