AEEditorCommon.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 CreateDefaultPreferences(String& path, JSONValue& prefs);
  31. bool ReadPreferences();
  32. SharedPtr<JSVM> vm_;
  33. private:
  34. };
  35. }