Cafu Engine
Group_Reorder.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_COMMAND_REORDER_GROUPS_HPP_INCLUDED
8 #define CAFU_COMMAND_REORDER_GROUPS_HPP_INCLUDED
9 
10 #include "../../CommandPattern.hpp"
11 
12 
13 class GroupT;
14 class MapDocumentT;
15 
16 
17 /// This class implements a command for changing the order of the groups in the map document.
19 {
20  public:
21 
22  /// The constructor for reordering the groups.
23  /// @param MapDoc The map document to reorder the groups in.
24  /// @param NewOrder The new order for the groups (a permutation of the MapDoc.GetGroups() array).
25  CommandReorderGroupsT(MapDocumentT& MapDoc, const ArrayT<GroupT*>& NewOrder);
26 
27  // Implementation of the CommandT interface.
28  bool Do();
29  void Undo();
30  wxString GetName() const;
31 
32 
33  private:
34 
35  MapDocumentT& m_MapDoc; ///< The map document to reorder the groups in.
36  const ArrayT<GroupT*> m_OldOrder; ///< The list of groups in previous order.
37  const ArrayT<GroupT*> m_NewOrder; ///< The list of groups in new order.
38 };
39 
40 #endif
void Undo()
This method un-does the command.
Definition: Group_Reorder.cpp:34
This class represents a CaWE "map" document.
Definition: MapDocument.hpp:45
This class implements a command for changing the order of the groups in the map document.
Definition: Group_Reorder.hpp:18
wxString GetName() const
Returns the name (a description) of the command.
Definition: Group_Reorder.cpp:48
bool Do()
This method executes the command.
Definition: Group_Reorder.cpp:19
This class represents groups.
Definition: Group.hpp:20
CommandReorderGroupsT(MapDocumentT &MapDoc, const ArrayT< GroupT * > &NewOrder)
The constructor for reordering the groups.
Definition: Group_Reorder.cpp:11
This class represents a general command for implementing modifications to the applications document...
Definition: CommandPattern.hpp:30