-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwybe.h
97 lines (75 loc) · 1.69 KB
/
wybe.h
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#ifndef WYBE_H
#define WYBE_H
#include<iostream>
#include<vector>
#include"stein.h"
#include"feld.h"
using namespace std;
struct node {
vector<pair<int, int> > neigbor;
pair<int, int> parent;
pair<int, int> self;
bool checked;
int weight;
node(): checked(false) {}
node(int selfFirst, int selfSecond):
self(selfFirst, selfSecond), checked(false) {}
bool checkDestiny(player p, int size) {
switch(p) {
case playerOne:
if(this->self.second == size - 1) {
return true;
} else {
return false;
} break;
case playerTwo:
if(this->self.first == size - 1) {
return true;
} else {
return false;
} break;
default:
return false;
}
}
};
struct priorityNode {
node * cNode;
int priority;
pair<int, int> predecessor;
};
struct compare {
bool operator() (const priorityNode a, const priorityNode b) const {
return a.priority > b.priority;
}
};
class wybe {
protected:
feld * game;
player me; //= playerTwo;
//player enemy = playerOne;
vector<vector<node> > graph;
int myWeight; // = 0;
pair<int, int> emptyWeight; //= (1, 5);
player status(int, int);
void buildGraph(player);
vector<pair<int, int> > dijkstra(player);
pair<int, int> crossPoint(vector<pair<int, int> >, vector<pair<int, int> >);
public:
wybe(feld * f):
game(f), myWeight(5), emptyWeight(20, 50) {}
wybe(feld * f, player p):
game(f), me(p), myWeight(5), emptyWeight(20, 50) {}
/*
void changeWeights(int my, pair<int, int> empty) {
this->myWeight = my;
this->emptyWeight = empty;
}
void changeWeights(pair<int, int> empty):
emptyWeight(empty) {}
void changeWeights(int my):
myWeight(my) {}
*/
void turn();
};
#endif //WYBE_H