1 // File: abstractboard.h
2 // part of libkombilo, http://www.u-go.net/kombilo/
4 // Copyright (c) 2006 Ulrich Goertz <u@g0ertz.de>
6 // Permission is hereby granted, free of charge, to any person obtaining a copy of
7 // this software and associated documentation files (the "Software"), to deal in
8 // the Software without restriction, including without limitation the rights to
9 // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
10 // of the Software, and to permit persons to whom the Software is furnished to do
11 // so, subject to the following conditions:
13 // The above copyright notice and this permission notice shall be included in all
14 // copies or substantial portions of the Software.
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 #ifndef _ABSTRACTBOARD_H_
25 #define _ABSTRACTBOARD_H_
36 typedef std::pair
<char,char> p_cc
;
46 MoveNC(char X
, char Y
, char COLOR
);
47 bool operator==(const MoveNC
& mnc
) const;
50 class Move
: public MoveNC
{
52 Move(char xx
, char yy
, char cc
);
55 Move
& operator=(const Move
& m
);
57 std::vector
<p_cc
>* captures
;
65 std::stack
<Move
> undostack
;
67 abstractBoard(int bs
= 19) throw(BoardError
);
68 abstractBoard(const abstractBoard
& ab
);
70 abstractBoard
& operator=(const abstractBoard
& ab
);
72 int play(int x
, int y
, char* color
) throw(BoardError
);
74 void remove(int x
, int y
);
75 char getStatus(int x
, int y
);
76 void setStatus(int x
, int y
, char val
);
77 int len_cap_last() throw(BoardError
);
78 void undostack_append_pass();
79 // abstractBoard& copy(const abstractBoard& ab);
82 int* neighbors(int x
, int y
);
83 std::vector
<p_cc
>* legal(int x
, int y
, char color
);
84 std::vector
<p_cc
>* hasNoLibExcP(int x1
, int y1
, int exc
=-1);