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.
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>
24 class TAGUA_EXPORT MoveSerializer
: public Component
, public IMoveSerializer
{
27 IValidator
* m_validator
;
29 virtual QString
suffix(const Move
& move
, const IState
* ref
) const;
31 virtual QString
san(const Move
& move
, const IState
* ref
) const;
33 virtual void minimal_notation(SAN
& san
, const IState
* ref
) const;
35 virtual Move
get_san(const SAN
& san
, const IState
* ref
) const;
37 virtual QChar
symbol(const IType
* type
) const;
39 virtual Move
parse_ics_verbose(const QString
& str
, const IState
* ref
) const;
42 * Create a serializer to a given string representation for moves.
43 * \param rep A move representation type.
45 MoveSerializer(const QString
& rep
, IValidator
* validator
);
47 virtual QString
serialize(const Move
& move
, const IState
* ref
) const;
49 virtual Move
deserialize(const QString
& str
, const IState
* ref
) const;
51 virtual QString
type() const;
56 #endif // CHESS__MOVESERIALIZER_H