AEEditorCommon.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
  3. // LICENSE: Atomic Game Engine Editor and Tools EULA
  4. // Please see LICENSE_ATOMIC_EDITOR_AND_TOOLS.md in repository root for
  5. // license information: https://github.com/AtomicGameEngine/AtomicGameEngine
  6. //
  7. #pragma once
  8. #include <Atomic/Engine/Application.h>
  9. #include <Atomic/Resource/JSONFile.h>
  10. using namespace Atomic;
  11. namespace Atomic
  12. {
  13. class JSVM;
  14. }
  15. namespace AtomicEditor
  16. {
  17. class AEEditorCommon : public Application
  18. {
  19. OBJECT(AEEditorCommon);
  20. public:
  21. /// Construct.
  22. AEEditorCommon(Context* context);
  23. /// Setup before engine initialization. Verify that a script file has been specified.
  24. virtual void Setup();
  25. /// Setup after engine initialization. Load the script and execute its start function.
  26. virtual void Start();
  27. /// Cleanup after the main loop. Run the script's stop function if it exists.
  28. virtual void Stop();
  29. protected:
  30. bool ReadPreferences(String& path, JSONValue& prefs, const String& propertyName = "");
  31. SharedPtr<JSVM> vm_;
  32. private:
  33. };
  34. }