Ported shogi.
[tagua/yd.git] / src / hlvariant / shogi / serializer.h
blobe7c2177f6bca7262a952f5b6c3137975d64c7780
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__SHOGI__SERIALIZER_H
12 #define HLVARIANT__SHOGI__SERIALIZER_H
14 #include <QString>
16 namespace HLVariant {
17 namespace Shogi {
19 template <typename _LegalityCheck>
20 class Serializer {
21 public:
22 enum {
23 SIMPLE = 0,
24 COMPACT = 1,
25 DECORATED = 2
28 typedef _LegalityCheck LegalityCheck;
29 typedef typename LegalityCheck::GameState GameState;
30 typedef typename GameState::Board Board;
31 typedef typename Board::Piece Piece;
32 typedef typename GameState::Move Move;
33 private:
34 int m_rep;
35 public:
36 Serializer(int rep);
38 QString serialize(const Move&, const GameState& ref);
39 Move deserialize(const QString& str, const GameState& ref);
42 // IMPLEMENTATION
44 template <typename LegalityCheck>
45 Serializer<LegalityCheck>::Serializer(int rep)
46 : m_rep(rep) { }
48 template <typename LegalityCheck>
49 QString Serializer<LegalityCheck>::serialize(const Move&, const GameState&) {
50 return "N/A"; // BROKEN
53 template <typename LegalityCheck>
54 typename Serializer<LegalityCheck>::Move Serializer<LegalityCheck>::deserialize(const QString&, const GameState&) {
55 return Move(); // BROKEN
58 } // namespace Shogi
59 } // namespace HLVariant
61 #endif // HLVARIANT__SHOGI__SERIALIZER_H