aboutsummaryrefslogtreecommitdiff
path: root/wonder.c
diff options
context:
space:
mode:
authorNathan Vance <nathav63@gmail.com>2015-02-20 17:18:43 -0500
committerNathan Vance <nathav63@gmail.com>2015-02-20 17:18:43 -0500
commitb29c03dd3b933d05e2f569acafeb7405971eb9e2 (patch)
treeea9090a2a45be4f675fde6023af1e49a886271b1 /wonder.c
parentStarted backend for game view (diff)
download7w-b29c03dd3b933d05e2f569acafeb7405971eb9e2.tar.gz
7w-b29c03dd3b933d05e2f569acafeb7405971eb9e2.tar.bz2
7w-b29c03dd3b933d05e2f569acafeb7405971eb9e2.zip
Added view for all wonders
Diffstat (limited to 'wonder.c')
-rw-r--r--wonder.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/wonder.c b/wonder.c
index 5fa2cc2..54ecba6 100644
--- a/wonder.c
+++ b/wonder.c
@@ -11,11 +11,13 @@ int data_getwonderside(int p);
void io_printborder(int x, int y);
int io_printtext(int xorigin, int y, int width, char* text);
void io_printcard(int x, int y, int wonder, int stage);
+void io_printname(int x, int y, int era, int card);
int data_getwonderstages(int p);
char* cat(char a[], char b[]);
char* itoa(int i);
int io_getkey();
void io_clearscreen();
+int* data_getbuilt(int p);
int wonder_hasstage(int wonder, int side, int stage)
{
@@ -46,10 +48,27 @@ void print_wonder(int x, int y, int player, int cursor)
text = cat(text, " ");
y = io_printtext(x, y, 29, text);
}
+ io_printborder(x, y++);
+
+ //Print what has been built
+ int *built = data_getbuilt(player);
+ for(i = 0; built[i] != -1; i+=2) {
+ io_printname(x, y++, built[i], built[i+1]);
+ }
+ if(i == 0) y--;
+
+ //Info about component
if(wonder_hasstage(data_getwonder(player), data_getwonderside(player), cursor))
io_printcard(x, y, data_getwonder(player), cursor+1+3*data_getwonderside(player));
}
+void print_wondersmall(int x, int y, int player)
+{
+ io_printborder(x, y++);
+ y = io_printtext(x, y, 29, cards_getname(data_getwonder(player), 0));
+ io_printborder(x, y);
+}
+
void wonder_selected(int player)
{
int cursor = 0;
bgstack15