blob: 71006568a1454ac0cfb786567becdfbfd02d8f0f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
#include "7w.h"
#include <stdlib.h>
void tester();
void io_init();
void cards_init();
void io_printcard(int x, int y, int era, int card);
void io_clearscreen();
int* getdeck(int era, int numplayers);
void data_init(int num_players);
void player_turn(int player);
void wonder_selected(int player);
void view_refresh(int focus, int cursor, int player);
int data_numplayers();
void halt()
{
endwin();
exit(0);
}
main()
{
io_init();
cards_init();
data_init(7);
// tester();
// wonder_selected(0);
player_turn(0);
halt();
}
void tester()
{
int focus, cursor, player;
focus = cursor = player = 0;
int numplayers = data_numplayers();
while(1) {
view_refresh(focus, cursor, player);
switch(io_getkey()) {
case DOWN: cursor++;
break;
case UP: if(cursor > 0) cursor--;
break;
case LEFT: if(focus > 0) focus--;
break;
case RIGHT: if(focus < numplayers) focus++;
break;
case ENTER: player = (player+1)%numplayers;
break;
case 'q': halt();
break;
default: break;
}
}
}
|