ToolSystem.h 1.1 KB

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