Game Development Reference
In-Depth Information
<?xml version="1.0" encoding="UTF-8"?>
<MyGameCommandBatch >
<command name="loadmap">
<param name=" ￿ infile" value="level1.map" />
</command >
<command name="ps3build">
<param name="outfile" value="level1.ps3map" />
</command >
<command name="x360build">
<param name="outfile" value="level1.x360map" />
</command >
<command name="closecurrentmap"/>
<MyGameCommandBatch />
Listing 13.1. Example batch file.
history is useful for repetitive tasks or for debugging purposes because it allows us
to know the operations the user has made and be able to reproduce them.
13.4 Improvements to the Command System
13.4.1 Undo/Redo
Undo/redo is a feature available in most modern applications and is also desirable
for our development tools. To obtain this feature, on the one hand, each command
must be able to undo its operation, and on the other hand, we need to store the
commands(alist,forexample)thathavebeenexecuted(see Figure13.5 ) .
Within that list there must be a reference to the last executed command. Thus,
if the user wants to undo a command, the previous command in the list will be
Command history
Most recent commands
Redo Command
Redo Command
Last Executed
Command
Undo Command
Undo Command
...
Next command to execute
in a redo operation.
Last executed command and first
command to undo.
Older com m ands
Figure 13.5. Undo/Redo command history.
 
 
Search WWH ::




Custom Search