Removed 'image' test (superseeded by 'luaimage' test)
[tagua/yd.git] / src / game_p.h
blob40ba03ce01f9f2f568d6724d413cc36e69760837
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@sns.it>
3 (c) 2006 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 __GAME_P_H__
12 #define __GAME_P_H__
14 #include <map>
15 #include <QString>
16 #include "game.h"
18 namespace GamePrivate {
20 typedef std::map<int, History> Variations;
21 typedef std::map<int, QString> VComments;
23 class Entry {
24 public:
25 MovePtr move;
26 PositionPtr position;
27 QString comment;
28 Variations variations;
29 VComments vcomments;
30 int last_var_id;
32 Entry(MovePtr move, PositionPtr position)
33 : move(move)
34 , position(position)
35 , last_var_id(0) { }
36 Entry()
37 : last_var_id(0) { }
38 ~Entry() { }
41 /* data and structs for undo */
42 class UndoAdd {
43 public:
44 Index index;
45 Entry entry;
46 UndoAdd(const Index& ix, const Entry& e)
47 : index(ix), entry(e) {}
50 class UndoPromote {
51 public:
52 Index index;
53 int variation;
54 UndoPromote(const Index& ix, int v)
55 : index(ix), variation(v) {}
58 class UndoTruncate {
59 public:
60 Index index;
61 History history;
62 Variations variations;
63 VComments vcomments;
64 UndoTruncate(const Index& ix)
65 : index(ix) {}
66 UndoTruncate(const Index& ix, const History& h,
67 const Variations& v, const VComments& c)
68 : index(ix), history(h), variations(v), vcomments(c) {}
71 class UndoRemove {
72 public:
73 Index index;
74 int variation;
75 History history;
76 QString vcomment;
77 UndoRemove(const Index& ix, int v, const History& h, const QString& c)
78 : index(ix), variation(v), history(h), vcomment(c) {}
80 class UndoClear {
81 public:
82 Index index;
83 Variations variations;
84 VComments vcomments;
85 UndoClear(const Index& ix, const Variations& v, const VComments& c)
86 : index(ix), variations(v), vcomments(c) {}
89 class UndoSetComment {
90 public:
91 Index index;
92 int variation;
93 QString old_comment;
94 QString new_comment;
95 UndoSetComment(const Index& ix, int v, const QString& o, const QString& n)
96 : index(ix), variation(v), old_comment(o), new_comment(n) {}
101 #endif //__GAME_P_H__