ToolSystem.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. void CloseProject();
  18. const String& GetDataPath() { return dataPath_; }
  19. void SetDataPath(const String& path) { dataPath_ = path; }
  20. // Platforms
  21. void RegisterPlatform(Platform* platform);
  22. Platform* GetPlatformByID(PlatformID platform);
  23. Platform* GetPlatformByName(const String& name);
  24. void SetCurrentPlatform(PlatformID platform);
  25. Platform* GetCurrentPlatform();
  26. void SetCLI() { cli_ = true; }
  27. bool IsCLI() { return cli_; }
  28. private:
  29. /// Full path to data files
  30. String dataPath_;
  31. SharedPtr<Platform> currentPlatform_;
  32. // PlatformID -> platform
  33. HashMap<unsigned, SharedPtr<Platform> > platforms_;
  34. SharedPtr<Project> project_;
  35. bool cli_;
  36. };
  37. }