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.
18 namespace GamePrivate
{
20 typedef std::map
<int, History
> Variations
;
21 typedef std::map
<int, QString
> VComments
;
24 * A class to store game entries
31 Variations variations
;
35 Entry(MovePtr move
, PositionPtr position
)
44 /* data and structs for undo */
49 UndoAdd(const Index
& ix
, const Entry
& e
)
50 : index(ix
), entry(e
) {}
57 UndoPromote(const Index
& ix
, int v
)
58 : index(ix
), variation(v
) {}
65 Variations variations
;
67 UndoTruncate(const Index
& ix
)
69 UndoTruncate(const Index
& ix
, const History
& h
,
70 const Variations
& v
, const VComments
& c
)
71 : index(ix
), history(h
), variations(v
), vcomments(c
) {}
80 UndoRemove(const Index
& ix
, int v
, const History
& h
, const QString
& c
)
81 : index(ix
), variation(v
), history(h
), vcomment(c
) {}
86 Variations variations
;
88 UndoClear(const Index
& ix
, const Variations
& v
, const VComments
& c
)
89 : index(ix
), variations(v
), vcomments(c
) {}
92 class UndoSetComment
{
98 UndoSetComment(const Index
& ix
, int v
, const QString
& o
, const QString
& n
)
99 : index(ix
), variation(v
), old_comment(o
), new_comment(n
) {}