aboutsummaryrefslogtreecommitdiff
path: root/view.c
diff options
context:
space:
mode:
authorNathan Vance <nathav63@gmail.com>2015-03-25 09:07:04 -0400
committerNathan Vance <nathav63@gmail.com>2015-03-25 09:07:04 -0400
commit48b4726624994097174fa820cd9c529177566d07 (patch)
treea2746ba8e310520b41e02d6e64db0ca910e7136e /view.c
parentImplemented ai trading (buggy) (diff)
download7w-48b4726624994097174fa820cd9c529177566d07.tar.gz
7w-48b4726624994097174fa820cd9c529177566d07.tar.bz2
7w-48b4726624994097174fa820cd9c529177566d07.zip
Discards are now tracked
Diffstat (limited to 'view.c')
-rw-r--r--view.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/view.c b/view.c
index 54c8ee8..88b8901 100644
--- a/view.c
+++ b/view.c
@@ -1,16 +1,18 @@
#include "7w.h"
-int print_wonder(int x, int y, int player, int cursor);
+int* print_wonder(int x, int y, int player, int cursor);
int print_wondersmall(int x, int y, int player, int selected, int dir);
int io_printhand(int x, int y, int player, int cursor);
+int io_printcard(int x, int y, int wonder, int stage, int player);
void io_clearscreen();
int data_numplayers();
void printmessage(int x, int y, int width);
int data_geteast(int p);
int data_getwest(int p);
-void view_printwonders(int focus, int cursor, int player)
+int* view_printwonders(int focus, int cursor, int player)
{
+ int *ret;
int num = data_numplayers();
int x, y, i, dir, p;
x = y = 0;
@@ -20,22 +22,26 @@ void view_printwonders(int focus, int cursor, int player)
if(p == data_geteast(player)) dir = 1;
if(p == data_getwest(player)) dir = 2;
if(focus == p)
- print_wonder(34, 0, p, cursor);
+ ret = print_wonder(34, 0, p, cursor);
y = print_wondersmall(x, y, p, focus == p, dir);
}
printmessage(0, y+2, 35);
+ return ret;
}
int view_refresh(int focus, int cursor, int player)
{
int ret;
+ int *card;
io_clearscreen();
if(focus == data_numplayers()) {
- view_printwonders(player, -1, player);
+ card = view_printwonders(player, -1, player);
ret = io_printhand(61, 0, player, cursor);
} else {
- view_printwonders((focus+player)%data_numplayers(), cursor, player);
+ card = view_printwonders((focus+player)%data_numplayers(), cursor, player);
ret = io_printhand(61, 0, player, -1);
}
+ if(card[0] != -1)
+ ret = io_printcard(61, ret-1, card[0], card[1], player);
return ret;
}
bgstack15