#include <execution.h>
Collaboration diagram for Execution:

Public Member Functions | |
| Execution (CommandSequence &, ExecutionEnvironment &) | |
| void | reset (CommandSequence &) |
| bool | tick (double) |
Private Attributes | |
| double | commandTime |
| CommandSequence::const_iterator | currentCommand |
| ExecutionEnvironment & | env |
| CommandSequence::const_iterator | finalCommand |
|
||||||||||||
|
Definition at line 15 of file execution.cpp. 00015 : 00016 currentCommand(cmd.begin()), 00017 finalCommand(cmd.end()), 00018 env(_env), 00019 commandTime(-1.0) 00020 { 00021 }
|
|
|
Definition at line 59 of file execution.cpp. References commandTime, currentCommand, and finalCommand. Referenced by RepeatCommand::process(). 00060 {
00061 currentCommand = cmd.begin();
00062 finalCommand = cmd.end();
00063 commandTime = -1.0;
00064 }
|
|
|
Definition at line 24 of file execution.cpp. References commandTime, currentCommand, env, finalCommand, Command::getDuration(), and Command::process(). Referenced by RepeatCommand::process(), CelScriptWrapper::tick(), and CelestiaCore::tick(). 00025 {
00026 // ignore the very first call to tick, because on windows dt may include the
00027 // time spent in the "Open File" dialog. Using commandTime < 0 as a flag
00028 // to recognize the first call:
00029 if (commandTime < 0.0)
00030 {
00031 commandTime = 0.0;
00032 return false;
00033 }
00034
00035 while (dt > 0.0 && currentCommand != finalCommand)
00036 {
00037 Command* cmd = *currentCommand;
00038
00039 double timeLeft = cmd->getDuration() - commandTime;
00040 if (dt >= timeLeft)
00041 {
00042 cmd->process(env, cmd->getDuration(), timeLeft);
00043 dt -= timeLeft;
00044 commandTime = 0.0;
00045 currentCommand++;
00046 }
00047 else
00048 {
00049 commandTime += dt;
00050 cmd->process(env, commandTime, dt);
00051 dt = 0.0;
00052 }
00053 }
00054
00055 return currentCommand == finalCommand;
00056 }
|
|
|
Definition at line 29 of file execution.h. |
|
|
Definition at line 26 of file execution.h. |
|
|
Definition at line 28 of file execution.h. Referenced by tick(). |
|
|
Definition at line 27 of file execution.h. |
1.4.1