Changeset 188 for 06/libkombilo/sgfparser.h
- Timestamp:
- 09/29/06 23:09:01 (2 years ago)
- Files:
-
- 1 modified
-
06/libkombilo/sgfparser.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
06/libkombilo/sgfparser.h
r186 r188 35 35 36 36 class SGFError { 37 public:38 SGFError();37 public: 38 SGFError(); 39 39 }; 40 40 41 41 class ExtendedMoveNumber { 42 public:43 int length;44 int* data; // "even" entries: go right, "odd" entries: go down in game tree.42 public: 43 int length; 44 int* data; // "even" entries: go right, "odd" entries: go down in game tree. 45 45 46 ExtendedMoveNumber();47 ExtendedMoveNumber(int LENGTH, int* DATA);48 ExtendedMoveNumber(int D);49 ExtendedMoveNumber(const ExtendedMoveNumber& emn);50 ~ExtendedMoveNumber();46 ExtendedMoveNumber(); 47 ExtendedMoveNumber(int LENGTH, int* DATA); 48 ExtendedMoveNumber(int D); 49 ExtendedMoveNumber(const ExtendedMoveNumber& emn); 50 ~ExtendedMoveNumber(); 51 51 52 ExtendedMoveNumber& operator=(const ExtendedMoveNumber& emn);53 void next();54 void down() throw(SGFError);55 int total_move_num();56 // void down();52 ExtendedMoveNumber& operator=(const ExtendedMoveNumber& emn); 53 void next(); 54 void down() throw(SGFError); 55 int total_move_num(); 56 // void down(); 57 57 }; 58 58 … … 61 61 62 62 class Node { 63 public:64 Node* previous;65 Node* next;66 Node* up;67 Node* down;68 int numChildren;69 int level;70 string SGFstring;71 int parsed;72 vector<string> gpv(const string& prop);73 vector<string>* get_property_value(const string& prop);74 void set_property_value(string& ID, vector<string>* propValue) throw(SGFError);63 public: 64 Node* previous; 65 Node* next; 66 Node* up; 67 Node* down; 68 int numChildren; 69 int level; 70 string SGFstring; 71 int parsed; 72 vector<string> gpv(const string& prop); 73 vector<string>* get_property_value(const string& prop); 74 void set_property_value(string& ID, vector<string>* propValue) throw(SGFError); 75 75 76 int posyD; // used when displaying SGF structure graphically as a tree76 int posyD; // used when displaying SGF structure graphically as a tree 77 77 78 Node(Node* prev, char* SGFst, int lvl) throw(SGFError);79 ~Node();80 ExtendedMoveNumber get_move_number();81 void parseNode() throw(SGFError);82 static int sloppy;83 private:84 map<string, vector<string>* > data; // use get_property_value to access this78 Node(Node* prev, char* SGFst, int lvl) throw(SGFError); 79 ~Node(); 80 ExtendedMoveNumber get_move_number(); 81 void parseNode() throw(SGFError); 82 static int sloppy; 83 private: 84 map<string, vector<string>* > data; // use get_property_value to access this 85 85 }; 86 86 … … 108 108 109 109 class Cursor { 110 public:111 Cursor(const char* sgf, int sloppy) throw(SGFError);112 ~Cursor();110 public: 111 Cursor(const char* sgf, int sloppy) throw(SGFError); 112 ~Cursor(); 113 113 114 int atStart;115 int atEnd;116 int height;117 int width;118 Node* root;119 Node* currentN;120 int posx;121 int posy;114 int atStart; 115 int atEnd; 116 int height; 117 int width; 118 Node* root; 119 Node* currentN; 120 int posx; 121 int posy; 122 122 123 void parse(const char* s) throw(SGFError);124 void game(int n) throw(SGFError);125 void next(int n=0) throw(SGFError);126 void previous() throw(SGFError);127 Node* getRootNode(int n) throw(SGFError);128 // void updateRootNode(PyObject* data, int n) throw(SGFError);129 char* outputVar(Node* node);130 char* output();131 void add(char* st);132 void delVariation(Node* node);133 void setFlags();123 void parse(const char* s) throw(SGFError); 124 void game(int n) throw(SGFError); 125 void next(int n=0) throw(SGFError); 126 void previous() throw(SGFError); 127 Node* getRootNode(int n) throw(SGFError); 128 // void updateRootNode(PyObject* data, int n) throw(SGFError); 129 char* outputVar(Node* node); 130 char* output(); 131 void add(char* st); 132 void delVariation(Node* node); 133 void setFlags(); 134 134 135 protected:136 void delVar(Node* node);137 void deltree(Node* node);135 protected: 136 void delVar(Node* node); 137 void deltree(Node* node); 138 138 139 139 };
