User moves are now created by the entity.
[tagua/yd.git] / src / hlvariant / dummy / gamestate.h
blob34ad14181cd8e394550b108f8d42fccc4d681334
1 /*
2 Copyright (c) 2007 Paolo Capriotti <p.capriotti@sns.it>
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.
9 */
11 #ifndef HLVARIANT__DUMMY__LEGALITYCHECK_H
12 #define HLVARIANT__DUMMY__LEGALITYCHECK_H
14 #include "../chess/legalitycheck.h"
15 #include "interactiontype.h"
16 #include "turnpolicy.h"
18 namespace HLVariant {
19 namespace Dummy {
21 template <typename _GameState>
22 class LegalityCheck {
23 public:
24 typedef _GameState GameState;
25 private:
26 typedef typename GameState::Board Board;
27 typedef typename GameState::Move Move;
28 typedef typename Board::Piece Piece;
29 public:
30 LegalityCheck(const GameState&) { }
32 virtual bool legal(Move& move) const { return true; }
33 virtual InteractionType movable(const TurnTest& test, const Point& p) { return Moving; }
34 virtual InteractionType droppable(const TurnTest& test, int index) { return Moving; }
37 } // namespace Dummy
38 } // namespace HLVariant
41 #endif // HLVARIANT__DUMMY__LEGALITYCHECK_H