Command.h 787 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #pragma once
  2. #include <Atomic/Core/Object.h>
  3. using namespace Atomic;
  4. namespace ToolCore
  5. {
  6. EVENT(E_COMMANDERROR, CommandError)
  7. {
  8. PARAM(P_MESSAGE, Message); // string
  9. }
  10. EVENT(E_COMMANDFINISHED, CommandFinished)
  11. {
  12. }
  13. class Command : public Object
  14. {
  15. OBJECT(Command);
  16. public:
  17. Command(Context* context);
  18. virtual ~Command();
  19. bool Parse(const String& command);
  20. virtual bool Parse(const Vector<String>& arguments, unsigned startIndex, String& errorMsg) = 0;
  21. virtual void Run() = 0;
  22. virtual void Finished();
  23. virtual void Error(const String& errorMsg);
  24. virtual void Cancel() {}
  25. virtual bool RequiresProjectLoad() { return true; }
  26. virtual bool RequiresLicenseValidation() { return false; }
  27. private:
  28. float timeOut_;
  29. };
  30. }