BsProjectLibraryEntries.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsEditorPrerequisites.h"
  5. #include "BsProjectLibrary.h"
  6. #include "BsIReflectable.h"
  7. namespace BansheeEngine
  8. {
  9. /**
  10. * @brief Contains a list of entries used by the ProjectLibrary. Used primarily
  11. * for serialization purposes, i.e. persisting ProjectLibrary state
  12. * between application runs.
  13. */
  14. class ProjectLibraryEntries : public IReflectable
  15. {
  16. struct ConstructPrivately { };
  17. public:
  18. explicit ProjectLibraryEntries(const ConstructPrivately& dummy);
  19. ProjectLibraryEntries(const ProjectLibrary::DirectoryEntry& rootEntry);
  20. /**
  21. * @brief Creates new project library entries based on a ProjectLibrary root directory entry.
  22. *
  23. * @param rootEntry Root directory entry in ProjectLibrary.
  24. */
  25. static std::shared_ptr<ProjectLibraryEntries> create(const ProjectLibrary::DirectoryEntry& rootEntry);
  26. /**
  27. * @brief Returns the root directory entry that references the entire entry hierarchy.
  28. */
  29. const ProjectLibrary::DirectoryEntry& getRootEntry() const { return mRootEntry; }
  30. private:
  31. ProjectLibrary::DirectoryEntry mRootEntry;
  32. /************************************************************************/
  33. /* SERIALIZATION */
  34. /************************************************************************/
  35. /**
  36. * @brief Creates new empty project library entries object. Used for serialization
  37. * purposes.
  38. */
  39. static std::shared_ptr<ProjectLibraryEntries> createEmpty();
  40. public:
  41. friend class ProjectLibraryEntriesRTTI;
  42. static RTTITypeBase* getRTTIStatic();
  43. virtual RTTITypeBase* getRTTI() const override;
  44. };
  45. }