LevelIndependentFileMan.cpp 991 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include "EditorDefs.h"
  9. #include "LevelIndependentFileMan.h"
  10. CLevelIndependentFileMan::CLevelIndependentFileMan()
  11. {
  12. }
  13. CLevelIndependentFileMan::~CLevelIndependentFileMan()
  14. {
  15. assert(m_Modules.size() == 0);
  16. }
  17. bool CLevelIndependentFileMan::PromptChangedFiles()
  18. {
  19. for (std::vector<ILevelIndependentFileModule*>::iterator it = m_Modules.begin(); it != m_Modules.end(); ++it)
  20. {
  21. if (!(*it)->PromptChanges())
  22. {
  23. return false;
  24. }
  25. }
  26. return true;
  27. }
  28. void CLevelIndependentFileMan::RegisterModule(ILevelIndependentFileModule* pModule)
  29. {
  30. stl::push_back_unique(m_Modules, pModule);
  31. }
  32. void CLevelIndependentFileMan::UnregisterModule(ILevelIndependentFileModule* pModule)
  33. {
  34. stl::find_and_erase(m_Modules, pModule);
  35. }