Cafu Engine
NewEntity.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_NEW_ENTITY_HPP_INCLUDED
8 #define CAFU_COMMAND_NEW_ENTITY_HPP_INCLUDED
9 
10 #include "../../CommandPattern.hpp"
11 #include "Templates/Pointer.hpp"
12 
13 
14 namespace cf { namespace GameSys { class EntityT; } }
15 class CommandSelectT;
16 class MapDocumentT;
17 
18 
19 /// This commands inserts a new entity into the map.
21 {
22  public:
23 
24  /// The constructor.
25  /// @param MapDoc Map document into which the entity is inserted.
26  /// @param Entity The entity to insert.
27  /// @param Parent The parent entity.
28  /// @param SetSel Whether the inserted entity should automatically be selected.
30 
31  /// The constructor.
32  /// @param MapDoc Map document into which the entities are inserted.
33  /// @param Entities The entities to insert.
34  /// @param Parent The parent entity.
35  /// @param SetSel Whether the inserted entities should automatically be selected.
37 
38  /// The destructor.
40 
41  // Implementation of the CommandT interface.
42  bool Do();
43  void Undo();
44  wxString GetName() const;
45 
46 
47  private:
48 
49  MapDocumentT& m_MapDoc;
52  const bool m_SetSel;
53  CommandSelectT* m_CommandSelect; ///< Subcommand for changing the selection.
54 };
55 
56 #endif
This class represents a CaWE "map" document.
Definition: MapDocument.hpp:45
CommandNewEntityT(MapDocumentT &MapDoc, IntrusivePtrT< cf::GameSys::EntityT > Entity, IntrusivePtrT< cf::GameSys::EntityT > Parent, bool SetSel)
The constructor.
Definition: NewEntity.cpp:20
~CommandNewEntityT()
The destructor.
Definition: NewEntity.cpp:41
Definition: Select.hpp:18
void Undo()
This method un-does the command.
Definition: NewEntity.cpp:81
bool Do()
This method executes the command.
Definition: NewEntity.cpp:51
wxString GetName() const
Returns the name (a description) of the command.
Definition: NewEntity.cpp:99
This class represents a general command for implementing modifications to the applications document...
Definition: CommandPattern.hpp:30
This commands inserts a new entity into the map.
Definition: NewEntity.hpp:20
Definition: Renderer.hpp:16