MultiplayerSampleModule.cpp 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0 OR MIT
  5. *
  6. */
  7. #include <AzCore/Memory/SystemAllocator.h>
  8. #include <AzCore/Module/Module.h>
  9. #include <Components/AttachPlayerWeaponComponent.h>
  10. #include <Components/ExampleFilteredEntityComponent.h>
  11. #include <Components/PerfTest/NetworkPrefabSpawnerComponent.h>
  12. #include <Components/UI/UiCoinCountComponent.h>
  13. #include <Components/UI/UiGameOverComponent.h>
  14. #include <Components/UI/UiPlayerArmorComponent.h>
  15. #include <Components/BackgroundMusicComponent.h>
  16. #include <Components/ScriptableDecalComponent.h>
  17. #include <Source/AutoGen/AutoComponentTypes.h>
  18. #include "MultiplayerSampleSystemComponent.h"
  19. #if AZ_TRAIT_CLIENT
  20. # include <Components/UI/HUDComponent.h>
  21. # include <Components/UI/UiMatchPlayerCoinCountsComponent.h>
  22. # include <Components/UI/UiRestBetweenRoundsComponent.h>
  23. # include <Components/UI/UiSettingsComponent.h>
  24. # include <Components/UI/UiStartMenuComponent.h>
  25. #endif
  26. namespace MultiplayerSample
  27. {
  28. class MultiplayerSampleModule
  29. : public AZ::Module
  30. {
  31. public:
  32. AZ_RTTI(MultiplayerSampleModule, "{9323FFB1-54AB-4665-889B-166CA2418C7C}", AZ::Module);
  33. AZ_CLASS_ALLOCATOR(MultiplayerSampleModule, AZ::SystemAllocator, 0);
  34. MultiplayerSampleModule()
  35. : AZ::Module()
  36. {
  37. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  38. m_descriptors.insert(m_descriptors.end(), {
  39. MultiplayerSampleSystemComponent::CreateDescriptor(),
  40. AttachPlayerWeaponComponent::CreateDescriptor(),
  41. ExampleFilteredEntityComponent::CreateDescriptor(),
  42. NetworkPrefabSpawnerComponent::CreateDescriptor(),
  43. UiCoinCountComponent::CreateDescriptor(),
  44. BackgroundMusicComponent::CreateDescriptor(),
  45. ScriptableDecalComponent::CreateDescriptor(),
  46. #if AZ_TRAIT_CLIENT
  47. HUDComponent::CreateDescriptor(),
  48. UiGameOverComponent::CreateDescriptor(),
  49. UiPlayerArmorComponent::CreateDescriptor(),
  50. UiMatchPlayerCoinCountsComponent::CreateDescriptor(),
  51. UiRestBetweenRoundsComponent::CreateDescriptor(),
  52. UiSettingsComponent::CreateDescriptor(),
  53. UiStartMenuComponent::CreateDescriptor(),
  54. #endif
  55. });
  56. CreateComponentDescriptors(m_descriptors);
  57. }
  58. /**
  59. * Add required SystemComponents to the SystemEntity.
  60. */
  61. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  62. {
  63. return AZ::ComponentTypeList{
  64. azrtti_typeid<MultiplayerSampleSystemComponent>(),
  65. };
  66. }
  67. };
  68. }
  69. // DO NOT MODIFY THIS LINE UNLESS YOU RENAME THE GEM
  70. // The first parameter should be GemName_GemIdLower
  71. // The second should be the fully qualified name of the class above
  72. #if defined(AZ_MONOLITHIC_BUILD)
  73. AZ_DECLARE_MODULE_CLASS(Gem_MultiplayerSample_Client, MultiplayerSample::MultiplayerSampleModule);
  74. AZ_DECLARE_MODULE_CLASS(Gem_MultiplayerSample_Server, MultiplayerSample::MultiplayerSampleModule);
  75. #endif
  76. AZ_DECLARE_MODULE_CLASS(Gem_MultiplayerSample, MultiplayerSample::MultiplayerSampleModule)