2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
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.
16 #include <core/move.h>
17 #include <core/state_fwd.h>
20 namespace GamePrivate
{
22 typedef std::map
<int, History
> Variations
;
23 typedef std::map
<int, QString
> VComments
;
26 * A class to store game entries
33 Variations variations
;
37 Entry(const Move
& move
, const StatePtr
& position
)
46 /* data and structs for undo */
51 UndoAdd(const Index
& ix
, const Entry
& e
)
52 : index(ix
), entry(e
) {}
59 UndoPromote(const Index
& ix
, int v
)
60 : index(ix
), variation(v
) {}
67 Variations variations
;
69 UndoTruncate(const Index
& ix
)
71 UndoTruncate(const Index
& ix
, const History
& h
,
72 const Variations
& v
, const VComments
& c
)
73 : index(ix
), history(h
), variations(v
), vcomments(c
) {}
82 UndoRemove(const Index
& ix
, int v
, const History
& h
, const QString
& c
)
83 : index(ix
), variation(v
), history(h
), vcomment(c
) {}
88 Variations variations
;
90 UndoClear(const Index
& ix
, const Variations
& v
, const VComments
& c
)
91 : index(ix
), variations(v
), vcomments(c
) {}
94 class UndoSetComment
{
100 UndoSetComment(const Index
& ix
, int v
, const QString
& o
, const QString
& n
)
101 : index(ix
), variation(v
), old_comment(o
), new_comment(n
) {}