2 Copyright (c) 2007 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2007 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
11 #ifndef CHESS__STATE_H
12 #define CHESS__STATE_H
14 #include <core/board.h>
15 #include <core/component.h>
16 #include <core/defaultstate.h>
17 #include <core/piece.h>
18 #include <core/taguaobject.h>
22 class State
: public Component
, public IDefaultState
{
28 State(const Point
& size
);
33 virtual IState
* clone() const;
37 virtual const Board
* board() const;
38 virtual Board
* board();
40 virtual const IColor
* turn() const;
42 virtual void setTurn(const IColor
* turn
);
44 virtual bool equals(IState
* other
) const;
46 virtual void assign(const IState
* other
);
48 virtual void move(const Move
& move
);
50 virtual TaguaObject
flags() const;
52 virtual Point
direction(const IColor
* turn
) const;
54 virtual void basicMove(const Move
& move
);
56 virtual void captureOn(const Point
& square
);
58 virtual int rank(int n
, const IColor
* turn
) const;
60 virtual Point
captureSquare(const Move
& move
) const;
62 virtual void advanceTurn();
64 virtual const IColor
* opponent(const IColor
* color
) const;
66 virtual Point
enPassantTrigger(const Move
& move
) const;
71 #endif // CHESS__STATE_H