CrySystemBus.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. #pragma once
  9. #include <AzCore/EBus/EBus.h>
  10. struct ISystem;
  11. struct SSystemInitParams;
  12. /*!
  13. * Events from CrySystem
  14. */
  15. class CrySystemEvents
  16. : public AZ::EBusTraits
  17. {
  18. public:
  19. //! ISystem has been created and is about to initialize.
  20. virtual void OnCrySystemPreInitialize(ISystem&, const SSystemInitParams&) {}
  21. //! ISystem and IConsole has been created but the cfg files have not been parsed
  22. virtual void OnCrySystemCVarRegistry() {}
  23. //! ISystem has been created and initialized.
  24. virtual void OnCrySystemInitialized(ISystem&, const SSystemInitParams&) {}
  25. //! In-Editor systems have been created and initialized.
  26. virtual void OnCryEditorInitialized() {}
  27. //! Editor has started a level export
  28. virtual void OnCryEditorBeginLevelExport() {}
  29. //! Editor has finished a level export
  30. virtual void OnCryEditorEndLevelExport(bool /*success*/) {}
  31. //! ISystem is about to begin shutting down
  32. virtual void OnCrySystemShutdown(ISystem&) {}
  33. //! ISystem has shut down.
  34. virtual void OnCrySystemPostShutdown() {}
  35. //! Sent when a new level is being created.
  36. virtual void OnCryEditorBeginCreate() {}
  37. //! Sent after a new level has been created.
  38. virtual void OnCryEditorEndCreate() {}
  39. //! Sent when a level is about to be loaded.
  40. virtual void OnCryEditorBeginLoad() {}
  41. //! Sent after a level has been loaded.
  42. virtual void OnCryEditorEndLoad() {}
  43. //! Sent when the document is about to close.
  44. virtual void OnCryEditorCloseScene() {}
  45. //! Sent when the document is closed.
  46. virtual void OnCryEditorSceneClosed() {}
  47. };
  48. using CrySystemEventBus = AZ::EBus<CrySystemEvents>;
  49. /*!
  50. * Requests to CrySystem
  51. */
  52. class CrySystemRequests
  53. : public AZ::EBusTraits
  54. {
  55. public:
  56. //! Get CrySystem
  57. virtual ISystem* GetCrySystem() = 0;
  58. };
  59. using CrySystemRequestBus = AZ::EBus<CrySystemRequests>;
  60. DECLARE_EBUS_EXTERN(CrySystemRequests);