Add MoveSerializer::type.
[tagua/yd.git] / src / variants / chess / moveserializer.h
blob08a887a494c903185c9d63518026961161edc710
1 /*
2 Copyright (c) 2007 Paolo Capriotti <p.capriotti@gmail.com>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8 */
10 #ifndef CHESS__MOVESERIALIZER_H
11 #define CHESS__MOVESERIALIZER_H
13 #include <core/component.h>
14 #include <core/move.h>
15 #include <core/moveserializer.h>
17 class IState;
18 class IType;
19 class SAN;
21 namespace Chess {
23 class TAGUA_EXPORT MoveSerializer : public Component, public IMoveSerializer {
24 protected:
25 QString m_rep;
27 virtual QString suffix(const Move& move, const IState* ref) const;
29 virtual QString san(const Move& move, const IState* ref) const;
31 virtual void minimal_notation(SAN& san, const IState* ref) const;
33 virtual Move get_san(const SAN& san, const IState* ref) const;
35 virtual QChar symbol(const IType* type) const;
37 virtual Move parse_ics_verbose(const QString& str, const IState* ref) const;
38 public:
39 /**
40 * Create a serializer to a given string representation for moves.
41 * \param rep A move representation type.
43 MoveSerializer(const QString& rep);
45 virtual QString serialize(const Move& move, const IState* ref) const;
47 virtual Move deserialize(const QString& str, const IState* ref) const;
49 virtual QString type() const;
52 } // namespace Chess
54 #endif // CHESS__MOVESERIALIZER_H