-
Notifications
You must be signed in to change notification settings - Fork 0
/
begin0cover.cpp
39 lines (35 loc) · 944 Bytes
/
begin0cover.cpp
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
#include "types.hpp"
#include "cards.hpp"
#include <iostream>
using namespace std;
// Init function
vector<Node> init_nodes() {
vector<string> concepts{"board", "hand", "played", "trump", "cover"};
vector<Node> nodes{Game()};
for (int i=0; i<concepts.size(); i++) {
nodes.push_back(Concept(concepts[i]));
}
return nodes;
}
vector<Action> actions{get_field_action, expand_list_action, higher_rank_action, beats_action};
vector<Node> nodes = init_nodes();
int main(void) {
Game g;
Card c0("6", "Hearts");
Card c1("King", "Spades");
cout << c0 << endl;
Pile hand(g.get("hand"));
hand.add(c0);
hand.add(c1);
cout << hand << endl;
Board board(g.get("board"));
board.play(c0);
board.cover(c0, c1, g);
cout << board << endl;
try {
board.cover(c1, c0, g);
} catch (Object ex) {
cout << "Got exception " << (ex == na) << endl;
}
return 0;
}