#include "../ToolSystem.h" #include "../Project/Project.h" #include "Command.h" namespace ToolCore { Command::Command(Context* context) : Object(context), timeOut_(0.0f) { } Command::~Command() { } bool Command::Parse(const String& command) { Vector args = command.Split(' '); String errorMsg; return Parse(args, 0, errorMsg); } void Command::Error(const String& errorMsg) { VariantMap eventData; eventData[CommandError::P_MESSAGE] = errorMsg; SendEvent(E_COMMANDERROR, eventData); } void Command::Finished() { ToolSystem* tsystem = GetSubsystem(); Project* project = tsystem->GetProject(); if (project && project->IsDirty()) project->Save(project->GetProjectFilePath()); SendEvent(E_COMMANDFINISHED); } }