Changeset 153 for 06/devel/pattern.h
- Timestamp:
- 04/15/04 16:23:16 (5 years ago)
- Files:
-
- 1 modified
-
06/devel/pattern.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
06/devel/pattern.h
r136 r153 1 typedef charp char*; 1 // File: pattern.h 2 3 // Copyright (C) 2004 Ulrich Goertz (u@g0ertz.de) 4 5 // This is part of Kombilo, a go database program. 6 7 // This program is free software; you can redistribute it and/or modify 8 // it under the terms of the GNU General Public License as published by 9 // the Free Software Foundation; either version 2 of the License, or 10 // (at your option) any later version. 11 12 // This program is distributed in the hope that it will be useful, 13 // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 // GNU General Public License for more details. 16 17 // You should have received a copy of the GNU General Public License 18 // along with this program (see doc/license.txt); if not, write to the Free Software 19 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 // The GNU GPL is also currently available at 21 // http://www.gnu.org/copyleft/gpl.html 22 23 24 using namespace std; 25 26 #include "Python.h" 27 #include <vector> 28 29 typedef char* charp; 2 30 3 31 class Symmetries { 32 public: 4 33 int* dataX; 5 34 int* dataY; … … 7 36 int sizeX; 8 37 int sizeY; 9 public: 10 Symmetries(int sX, int sY); 38 Symmetries(int sX=0, int sY=0); 11 39 ~Symmetries(); 12 40 Symmetries(const Symmetries& s); … … 17 45 int getCS(int i, int j); 18 46 int has_key(int i, int j); 47 int special; 19 48 }; 20 49 … … 36 65 int lenContList; 37 66 38 Pattern(PyObject* anch, PyObject* initialDict, PyObject* contList, char mOne); 67 Pattern(); 68 Pattern(int le, int ri, int to, int bo, int sX, int sY, 69 char* iPos, char* cList, int lenCList, char mOne); 39 70 Pattern(const Pattern& p); 40 71 ~Pattern(); 41 Pattern& operator=(const Pattern& p); 72 Pattern& copy(const Pattern& p); 73 74 char getInitial(int i, int j); 75 char getFinal(int i, int j); 76 char getBits(int b, int i); 42 77 43 78 char BW2XO(char c); 44 bool operator==(const &Pattern p); 45 } 79 int operator==(const Pattern& p); 80 81 static int flipsX(int i, int x, int y, int XX, int YY); 82 static int flipsY(int i, int x, int y, int XX, int YY); 83 static int PatternInvFlip(int i); 84 85 }; 46 86 47 87 48 88 class PatternList { 49 89 public: 90 int boardsize; 50 91 Pattern pattern; 51 92 int fixedColor, nextMove; … … 53 94 Symmetries symmetries; 54 95 55 PatternList(Pattern p, int fColor, int nMove);96 PatternList(Pattern& p, int fColor, int nMove, int bsize); 56 97 PatternList(const PatternList& pl); 57 98 PatternList& operator=(const PatternList& pl); … … 59 100 char invertColor(char co); 60 101 vector<Pattern> patternList(); 61 Pattern get(int i);102 Pattern& get(int i); 62 103 int size(); 63 updateContinuations(); 104 PyObject* updateContinuations(int index, int x, int y, char co, int Xint0, int Xint1, 105 int Yint0, int Yint1, 106 int foundWhere, int counter, 107 PyObject* continuations, char* contLabels, int contLabelsIndex, 108 char winner); 64 109 }; 65 110
