|
Revision 1, 2.6 kB
(checked in by ugz, 5 years ago)
|
Initial repository layout
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
#include "Python.h" |
|---|
| 24 |
|
|---|
| 25 |
class SGFError { |
|---|
| 26 |
public: |
|---|
| 27 |
SGFError(); |
|---|
| 28 |
}; |
|---|
| 29 |
|
|---|
| 30 |
char* SGFescape(char* s); |
|---|
| 31 |
|
|---|
| 32 |
class Node { |
|---|
| 33 |
public: |
|---|
| 34 |
Node* previous; |
|---|
| 35 |
Node* next; |
|---|
| 36 |
Node* up; |
|---|
| 37 |
Node* down; |
|---|
| 38 |
int numChildren; |
|---|
| 39 |
int level; |
|---|
| 40 |
char* SGFstring; |
|---|
| 41 |
int parsed; |
|---|
| 42 |
PyObject* data; |
|---|
| 43 |
|
|---|
| 44 |
int posyD; |
|---|
| 45 |
|
|---|
| 46 |
Node(Node* prev, char* SGFst, int lvl) throw(SGFError); |
|---|
| 47 |
~Node(); |
|---|
| 48 |
PyObject* pathToNode(); |
|---|
| 49 |
void parseNode() throw(SGFError); |
|---|
| 50 |
PyObject* getData(); |
|---|
| 51 |
|
|---|
| 52 |
static int sloppy; |
|---|
| 53 |
}; |
|---|
| 54 |
|
|---|
| 55 |
class Cursor { |
|---|
| 56 |
public: |
|---|
| 57 |
Cursor(char* sgf, int sloppy) throw(SGFError); |
|---|
| 58 |
~Cursor(); |
|---|
| 59 |
|
|---|
| 60 |
int atStart; |
|---|
| 61 |
int atEnd; |
|---|
| 62 |
int height; |
|---|
| 63 |
int width; |
|---|
| 64 |
Node* root; |
|---|
| 65 |
Node* currentN; |
|---|
| 66 |
int posx; |
|---|
| 67 |
int posy; |
|---|
| 68 |
|
|---|
| 69 |
int noChildren(); |
|---|
| 70 |
PyObject* currentNode(); |
|---|
| 71 |
void parse(char* s) throw(SGFError); |
|---|
| 72 |
void game(int n) throw(SGFError); |
|---|
| 73 |
PyObject* next(int n=0) throw(SGFError); |
|---|
| 74 |
PyObject* previous() throw(SGFError); |
|---|
| 75 |
PyObject* getRootNode(int n) throw(SGFError); |
|---|
| 76 |
void updateCurrentNode() throw(SGFError); |
|---|
| 77 |
void updateRootNode(PyObject* data, int n) throw(SGFError); |
|---|
| 78 |
char* rootNodeToString(PyObject* data); |
|---|
| 79 |
char* nodeToString(PyObject* data) throw(SGFError); |
|---|
| 80 |
char* outputVar(Node* node); |
|---|
| 81 |
char* output(); |
|---|
| 82 |
void add(char* st); |
|---|
| 83 |
void delVariation(Node* node); |
|---|
| 84 |
void setFlags(); |
|---|
| 85 |
|
|---|
| 86 |
protected: |
|---|
| 87 |
void delVar(Node* node); |
|---|
| 88 |
void deltree(Node* node); |
|---|
| 89 |
|
|---|
| 90 |
}; |
|---|
| 91 |
|
|---|
| 92 |
class intN { |
|---|
| 93 |
public: |
|---|
| 94 |
int data; |
|---|
| 95 |
intN* prev; |
|---|
| 96 |
intN(int i, intN* p); |
|---|
| 97 |
}; |
|---|
| 98 |
|
|---|
| 99 |
class IntStack { |
|---|
| 100 |
public: |
|---|
| 101 |
intN* root; |
|---|
| 102 |
IntStack(); |
|---|
| 103 |
void push(int i); |
|---|
| 104 |
void pop(); |
|---|
| 105 |
int top(); |
|---|
| 106 |
bool nonempty(); |
|---|
| 107 |
}; |
|---|
| 108 |
|
|---|
| 109 |
class nodeN { |
|---|
| 110 |
public: |
|---|
| 111 |
Node* data; |
|---|
| 112 |
nodeN* prev; |
|---|
| 113 |
nodeN(Node* i, nodeN* p); |
|---|
| 114 |
}; |
|---|
| 115 |
|
|---|
| 116 |
class NodeStack { |
|---|
| 117 |
public: |
|---|
| 118 |
nodeN* root; |
|---|
| 119 |
NodeStack(); |
|---|
| 120 |
void push(Node* i); |
|---|
| 121 |
void pop(); |
|---|
| 122 |
Node* top(); |
|---|
| 123 |
bool nonempty(); |
|---|
| 124 |
}; |
|---|
| 125 |
|
|---|