ToolSystem.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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/Core/Object.h>
  9. #include "Platform/Platform.h"
  10. using namespace Atomic;
  11. namespace ToolCore
  12. {
  13. class Platform;
  14. class Project;
  15. class ToolSystem : public Object
  16. {
  17. OBJECT(ToolSystem);
  18. public:
  19. ToolSystem(Context* context);
  20. virtual ~ToolSystem();
  21. bool LoadProject(const String& fullpath);
  22. Project* GetProject() { return project_; }
  23. void CloseProject();
  24. const String& GetDataPath() { return dataPath_; }
  25. void SetDataPath(const String& path) { dataPath_ = path; }
  26. // Platforms
  27. void RegisterPlatform(Platform* platform);
  28. Platform* GetPlatformByID(PlatformID platform);
  29. Platform* GetPlatformByName(const String& name);
  30. void SetCurrentPlatform(PlatformID platform);
  31. Platform* GetCurrentPlatform();
  32. void SetCLI() { cli_ = true; }
  33. bool IsCLI() { return cli_; }
  34. private:
  35. /// Full path to data files
  36. String dataPath_;
  37. SharedPtr<Platform> currentPlatform_;
  38. // PlatformID -> platform
  39. HashMap<unsigned, SharedPtr<Platform> > platforms_;
  40. SharedPtr<Project> project_;
  41. bool cli_;
  42. };
  43. }