src/editHistory.h

Wed, 05 Nov 2014 02:07:38 +0200

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Wed, 05 Nov 2014 02:07:38 +0200
branch
experimental
changeset 906
d2b3c8ce8817
parent 844
11587d419d2f
child 927
409b82a4765e
child 944
1a6f1997fcbe
permissions
-rw-r--r--

- merged bfc with default

655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
1 /*
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
2 * LDForge: LDraw parts authoring CAD
844
11587d419d2f - changed copyright lines to use my legal name instead of my nickname
Teemu Piippo <crimsondusk64@gmail.com>
parents: 794
diff changeset
3 * Copyright (C) 2013, 2014 Teemu Piippo
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
4 *
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
5 * This program is free software: you can redistribute it and/or modify
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
7 * the Free Software Foundation, either version 3 of the License, or
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
8 * (at your option) any later version.
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
9 *
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
13 * GNU General Public License for more details.
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
14 *
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
17 */
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
18
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
19 #pragma once
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
20 #include "main.h"
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
21 #include "ldObject.h"
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
22
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
23 #define IMPLEMENT_HISTORY_TYPE(N) \
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
24 virtual ~N##History() {} \
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
25 virtual void undo() const override; \
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
26 virtual void redo() const override; \
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
27 \
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
28 virtual History::EHistoryType getType() const override \
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
29 { \
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
30 return History::E##N##History; \
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
31 } \
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
32 \
789
4b7306f52bb5 - String -> QString
Santeri Piippo <crimsondusk64@gmail.com>
parents: 784
diff changeset
33 virtual QString getTypeName() const \
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
34 { \
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
35 return #N; \
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
36 }
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
37
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
38 class AbstractHistoryEntry;
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
39
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
40 // =============================================================================
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
41 class History
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
42 {
784
f82ab4d3c7b4 - made LDDocument use shared pointers, this eliminates a lot of document-related crashes
Santeri Piippo <crimsondusk64@gmail.com>
parents: 768
diff changeset
43 PROPERTY (private, int, position, setPosition, STOCK_WRITE)
f82ab4d3c7b4 - made LDDocument use shared pointers, this eliminates a lot of document-related crashes
Santeri Piippo <crimsondusk64@gmail.com>
parents: 768
diff changeset
44 PROPERTY (public, LDDocumentWeakPtr, document, setDocument, STOCK_WRITE)
f82ab4d3c7b4 - made LDDocument use shared pointers, this eliminates a lot of document-related crashes
Santeri Piippo <crimsondusk64@gmail.com>
parents: 768
diff changeset
45 PROPERTY (public, bool, isIgnoring, setIgnoring, STOCK_WRITE)
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
46
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
47 public:
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
48 typedef QList<AbstractHistoryEntry*> Changeset;
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
49
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
50 enum EHistoryType
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
51 {
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
52 EDelHistory,
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
53 EEditHistory,
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
54 EAddHistory,
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
55 EMoveHistory,
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
56 ESwapHistory,
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
57 };
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
58
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
59 History();
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
60 void undo();
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
61 void redo();
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
62 void clear();
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
63
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
64 void addStep();
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
65 void add (AbstractHistoryEntry* entry);
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
66
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
67 inline long getSize() const
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
68 {
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
69 return m_changesets.size();
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
70 }
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
71
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
72 inline History& operator<< (AbstractHistoryEntry* entry)
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
73 {
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
74 add (entry);
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
75 return *this;
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
76 }
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
77
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
78 inline const Changeset& getChangeset (long pos) const
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
79 {
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
80 return m_changesets[pos];
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
81 }
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
82
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
83 private:
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
84 Changeset m_currentChangeset;
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
85 QList<Changeset> m_changesets;
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
86 };
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
87
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
88 // =============================================================================
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
89 //
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
90 class AbstractHistoryEntry
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
91 {
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
92 PROPERTY (public, History*, parent, setParent, STOCK_WRITE)
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
93
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
94 public:
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
95 virtual ~AbstractHistoryEntry() {}
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
96 virtual void undo() const = 0;
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
97 virtual void redo() const = 0;
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
98 virtual History::EHistoryType getType() const = 0;
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
99 virtual QString getTypeName() const = 0;
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
100 };
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
101
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
102 // =============================================================================
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
103 //
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
104 class DelHistory : public AbstractHistoryEntry
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
105 {
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
106 PROPERTY (private, int, index, setIndex, STOCK_WRITE)
789
4b7306f52bb5 - String -> QString
Santeri Piippo <crimsondusk64@gmail.com>
parents: 784
diff changeset
107 PROPERTY (private, QString, code, setCode, STOCK_WRITE)
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
108
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
109 public:
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
110 IMPLEMENT_HISTORY_TYPE (Del)
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
111 DelHistory (int idx, LDObjectPtr obj);
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
112 };
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
113
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
114 // =============================================================================
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
115 //
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
116 class EditHistory : public AbstractHistoryEntry
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
117 {
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
118 PROPERTY (private, int, index, setIndex, STOCK_WRITE)
789
4b7306f52bb5 - String -> QString
Santeri Piippo <crimsondusk64@gmail.com>
parents: 784
diff changeset
119 PROPERTY (private, QString, oldCode, setOldCode, STOCK_WRITE)
4b7306f52bb5 - String -> QString
Santeri Piippo <crimsondusk64@gmail.com>
parents: 784
diff changeset
120 PROPERTY (private, QString, newCode, setNewCode, STOCK_WRITE)
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
121
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
122 public:
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
123 IMPLEMENT_HISTORY_TYPE (Edit)
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
124
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
125 EditHistory (int idx, QString oldCode, QString newCode) :
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
126 m_index (idx),
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
127 m_oldCode (oldCode),
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
128 m_newCode (newCode) {}
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
129 };
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
130
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
131 // =============================================================================
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
132 //
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
133 class AddHistory : public AbstractHistoryEntry
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
134 {
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
135 PROPERTY (private, int, index, setIndex, STOCK_WRITE)
789
4b7306f52bb5 - String -> QString
Santeri Piippo <crimsondusk64@gmail.com>
parents: 784
diff changeset
136 PROPERTY (private, QString, code, setCode, STOCK_WRITE)
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
137
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
138 public:
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
139 IMPLEMENT_HISTORY_TYPE (Add)
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
140
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
141 AddHistory (int idx, LDObjectPtr obj) :
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
142 m_index (idx),
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
143 m_code (obj->asText()) {}
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
144 };
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
145
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
146 // =============================================================================
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
147 //
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
148 class MoveHistory : public AbstractHistoryEntry
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
149 {
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
150 public:
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
151 IMPLEMENT_HISTORY_TYPE (Move)
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
152
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
153 QList<int> indices;
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
154 Vertex dest;
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
155
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
156 MoveHistory (QList<int> indices, Vertex dest) :
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
157 indices (indices),
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
158 dest (dest) {}
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
159 };
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
160
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
161 // =============================================================================
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
162 //
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
163 class SwapHistory : public AbstractHistoryEntry
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
164 {
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
165 public:
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
166 IMPLEMENT_HISTORY_TYPE (Swap)
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
167
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
168 SwapHistory (int a, int b) :
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
169 a (a),
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
170 b (b) {}
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
171
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
172 private:
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 789
diff changeset
173 int a, b;
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
174 };

mercurial