Cafu Engine
Select.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_SELECT_HPP_INCLUDED
8 #define CAFU_COMMAND_SELECT_HPP_INCLUDED
9 
10 #include "../../CommandPattern.hpp"
11 
12 
13 class MapDocumentT;
14 class MapElementT;
15 class MapPrimitiveT;
16 
17 
18 class CommandSelectT : public CommandT
19 {
20  public:
21 
22  // Named constructors for easier command creation.
23  static CommandSelectT* Clear (MapDocumentT* MapDocument);
24  static CommandSelectT* Add (MapDocumentT* MapDocument, const ArrayT<MapElementT*>& MapElements);
25  static CommandSelectT* Add (MapDocumentT* MapDocument, MapElementT* MapElement);
26  static CommandSelectT* Remove(MapDocumentT* MapDocument, const ArrayT<MapElementT*>& MapElements);
27  static CommandSelectT* Remove(MapDocumentT* MapDocument, MapElementT* MapElement);
28  static CommandSelectT* Set (MapDocumentT* MapDocument, const ArrayT<MapElementT*>& MapElements);
29  static CommandSelectT* Set (MapDocumentT* MapDocument, MapElementT* MapElement);
30  static CommandSelectT* Set (MapDocumentT* MapDocument, const ArrayT<MapPrimitiveT*>& Primitives);
31 
32  ~CommandSelectT();
33 
34  // CommandT implementation.
35  bool Do();
36  void Undo();
37  wxString GetName() const;
38 
39 
40  private:
41 
42  // Only named constructors may create this command.
43  CommandSelectT(MapDocumentT* MapDocument, const ArrayT<MapElementT*>& OldSelection, const ArrayT<MapElementT*>& NewSelection);
44 
45  MapDocumentT* m_MapDocument;
46 
47  const ArrayT<MapElementT*> m_OldSelection;
48  const ArrayT<MapElementT*> m_NewSelection;
49 };
50 
51 #endif
This class represents a CaWE "map" document.
Definition: MapDocument.hpp:45
This class adds no functionality of its own, but only exists for proper type separation.
Definition: MapPrimitive.hpp:21
void Undo()
This method un-does the command.
Definition: Select.cpp:173
Definition: Select.hpp:18
bool Do()
This method executes the command.
Definition: Select.cpp:157
wxString GetName() const
Returns the name (a description) of the command.
Definition: Select.cpp:187
This class represents a general command for implementing modifications to the applications document...
Definition: CommandPattern.hpp:30
This is the base class for all elements ("objects") that can exist in a map.
Definition: MapElement.hpp:57