Cafu Engine
ReparentPrimitive.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_REPARENT_PRIMITIVE_HPP_INCLUDED
8 #define CAFU_COMMAND_REPARENT_PRIMITIVE_HPP_INCLUDED
9 
10 #include "../../CommandPattern.hpp"
11 #include "Templates/Pointer.hpp"
12 
13 
14 namespace MapEditor { class CompMapEntityT; }
15 class MapDocumentT;
16 class MapPrimitiveT;
17 
18 
19 namespace MapEditor
20 {
21  /// A command to assign one or several map primitives to another entity.
23  {
24  public:
25 
26  /// The constructor for assigning a map primitive to another entity.
28 
29  /// The constructor for assigning several map primitives to another entity.
31 
32  // Implementation of the CommandT interface.
33  bool Do();
34  void Undo();
35  wxString GetName() const;
36 
37 
38  private:
39 
40  MapDocumentT& m_MapDoc;
41  ArrayT<MapPrimitiveT*> m_Prims;
44  };
45 }
46 
47 #endif
CommandReparentPrimitiveT(MapDocumentT &MapDoc, MapPrimitiveT *Prim, IntrusivePtrT< CompMapEntityT > NewParent)
The constructor for assigning a map primitive to another entity.
Definition: ReparentPrimitive.cpp:17
This class represents a CaWE "map" document.
Definition: MapDocument.hpp:45
bool Do()
This method executes the command.
Definition: ReparentPrimitive.cpp:39
This class adds no functionality of its own, but only exists for proper type separation.
Definition: MapPrimitive.hpp:21
wxString GetName() const
Returns the name (a description) of the command.
Definition: ReparentPrimitive.cpp:101
A command to assign one or several map primitives to another entity.
Definition: ReparentPrimitive.hpp:22
void Undo()
This method un-does the command.
Definition: ReparentPrimitive.cpp:73
This class represents a general command for implementing modifications to the applications document...
Definition: CommandPattern.hpp:30