Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Command.h
Go to the documentation of this file.
1 /* Project Magic 2.0
2  Destroyer Studios LLC
3  Copyright © 1997-2005. All Rights Reserved.
4 
5  SUBSYSTEM: Magic.exe
6  FILE: Command.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Base class (interface) for command pattern. A
13  command encapsulates a single editing operation
14  that may be performed on a document. Each command
15  may be done or undone multiple times. The specialized
16  implementations for each type of operation are re-
17  sponsible for providing a means to return the model
18  to the prior state.
19 */
20 
21 #ifndef Command_h
22 #define Command_h
23 
24 #include "Text.h"
25 
26 // +--------------------------------------------------------------------+
27 
28 class MagicDoc;
29 class Solid;
30 class Model;
31 
32 // +--------------------------------------------------------------------+
33 
34 class Command
35 {
36 public:
37  static const char* TYPENAME() { return "Command"; }
38 
39  Command(const char* name, MagicDoc* document);
40  virtual ~Command();
41 
42  // operations
43  virtual void Do();
44  virtual void Undo();
45 
46  const char* Name() const { return name; }
47 
48 protected:
51 };
52 
53 // +--------------------------------------------------------------------+
54 
55 #endif Command_h