AEProject.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
  2. // Please see LICENSE.md in repository root for license information
  3. // https://github.com/AtomicGameEngine/AtomicGameEngine
  4. #pragma once
  5. #include <Atomic/IO/FileSystem.h>
  6. #include <Atomic/Core/Object.h>
  7. using namespace Atomic;
  8. namespace AtomicEditor
  9. {
  10. class Project : public Object
  11. {
  12. OBJECT(Project);
  13. public:
  14. /// Construct.
  15. Project(Context* context);
  16. /// Destruct.
  17. virtual ~Project();
  18. const String GetResourcePath() { return resourcePath_; }
  19. void SetResourcePath(const String& resourcePath)
  20. {
  21. resourcePath_ = AddTrailingSlash(resourcePath);
  22. componentsPath_ = resourcePath_ + "Components";
  23. scriptsPath_ = resourcePath_ + "Scripts";
  24. modulesPath_ = resourcePath_ + "Modules";
  25. }
  26. void Load(const String& fullpath);
  27. void Save(const String& fullpath = "");
  28. const String& GetComponentsPath() { return componentsPath_; }
  29. const String& GetScriptsPath() { return scriptsPath_; }
  30. const String& GetModulesPath() { return modulesPath_; }
  31. const String& GetProjectFilePath() { return projectFilePath_; }
  32. bool IsComponentsDirOrFile(const String& fullPath);
  33. bool IsScriptsDirOrFile(const String& fullPath);
  34. bool IsModulesDirOrFile(const String& fullPath);
  35. const String& GetLastBuildPath() { return lastBuildPath_; }
  36. void SetLastBuildPath(const String& path) { lastBuildPath_ = path; }
  37. private:
  38. void LoadUserPrefs(const String& fullpath);
  39. void SaveUserPrefs(const String& fullpath);
  40. String GetUserPrefsFullPath(const String& projectPath);
  41. String projectFilePath_;
  42. String resourcePath_;
  43. String componentsPath_;
  44. String scriptsPath_;
  45. String modulesPath_;
  46. String lastBuildPath_;
  47. bool loading_;
  48. };
  49. }