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.
22 * @brief A piece type.
24 * Piece types are associated to graphical representation of pieces,
25 * and to movement rules.
27 class TAGUA_EXPORT IType
{
32 * @return The name of this type.
34 virtual QString
name() const = 0;
37 * Check if this piece type can perform a given move.
38 * @param piece A piece of this type.
39 * @param target The piece that would be captured by the move.
40 * @param move The move to be checked.
41 * @param state The state in which @a move is to be played.
43 virtual bool canMove(const Piece
& piece
, const Piece
& target
,
44 Move
& move
, const IState
* state
) const = 0;
47 * A symbolic index associated to this type.
48 * This is not required to uniquely identify the type.
49 * It can be used to sort a collection of types.
51 virtual int index() const = 0;
54 #endif // CORE__TYPE_H