Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Command.cpp
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.cpp
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
#include "
stdafx.h
"
22
#include "
Command.h
"
23
24
// +--------------------------------------------------------------------+
25
26
void
Print
(
const
char
* msg, ...);
27
28
// +--------------------------------------------------------------------+
29
30
Command::Command
(
const
char
* n,
MagicDoc
* d)
31
: name(n), document(d)
32
{
33
}
34
35
Command::~Command
()
36
{
37
document
= 0;
38
}
39
40
// +--------------------------------------------------------------------+
41
42
void
43
Command::Do
()
44
{
45
Print
(
"WARNING: Command::Do() called for '%s'\n"
,
name
.
data
());
46
}
47
48
void
49
Command::Undo
()
50
{
51
Print
(
"WARNING: Command::Undo() called for '%s'\n"
,
name
.
data
());
52
}
Magic2
Command.cpp
Generated on Tue Jun 5 2012 20:46:14 for Starshatter_Open by
1.8.1