MultiplayerSampleModule.cpp 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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/PerfTest/NetworkRandomImpulseComponent.h>
  13. #include <Components/PerfTest/NetworkTestSpawnerComponent.h>
  14. #include <Components/UI/UiCoinCountComponent.h>
  15. #include <Components/UI/UiGameOverComponent.h>
  16. #include <Components/UI/UiPlayerArmorComponent.h>
  17. #if AZ_TRAIT_CLIENT
  18. #include <Components/UI/HUDComponent.h>
  19. #include <Components/UI/UiMatchPlayerCoinCountsComponent.h>
  20. #include <Components/UI/UiRestBetweenRoundsComponent.h>
  21. #include <Components/UI/UiStartMenuComponent.h>
  22. #endif
  23. #include <Source/AutoGen/AutoComponentTypes.h>
  24. #include "MultiplayerSampleSystemComponent.h"
  25. namespace MultiplayerSample
  26. {
  27. class MultiplayerSampleModule
  28. : public AZ::Module
  29. {
  30. public:
  31. AZ_RTTI(MultiplayerSampleModule, "{9323FFB1-54AB-4665-889B-166CA2418C7C}", AZ::Module);
  32. AZ_CLASS_ALLOCATOR(MultiplayerSampleModule, AZ::SystemAllocator, 0);
  33. MultiplayerSampleModule()
  34. : AZ::Module()
  35. {
  36. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  37. m_descriptors.insert(m_descriptors.end(), {
  38. MultiplayerSampleSystemComponent::CreateDescriptor(),
  39. AttachPlayerWeaponComponent::CreateDescriptor(),
  40. ExampleFilteredEntityComponent::CreateDescriptor(),
  41. NetworkPrefabSpawnerComponent::CreateDescriptor(),
  42. UiCoinCountComponent::CreateDescriptor(),
  43. #if AZ_TRAIT_CLIENT
  44. HUDComponent::CreateDescriptor(),
  45. UiGameOverComponent::CreateDescriptor(),
  46. UiPlayerArmorComponent::CreateDescriptor(),
  47. UiMatchPlayerCoinCountsComponent::CreateDescriptor(),
  48. UiRestBetweenRoundsComponent::CreateDescriptor(),
  49. UiStartMenuComponent::CreateDescriptor()
  50. #endif
  51. });
  52. CreateComponentDescriptors(m_descriptors);
  53. }
  54. /**
  55. * Add required SystemComponents to the SystemEntity.
  56. */
  57. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  58. {
  59. return AZ::ComponentTypeList{
  60. azrtti_typeid<MultiplayerSampleSystemComponent>(),
  61. };
  62. }
  63. };
  64. }
  65. // DO NOT MODIFY THIS LINE UNLESS YOU RENAME THE GEM
  66. // The first parameter should be GemName_GemIdLower
  67. // The second should be the fully qualified name of the class above
  68. #if defined(AZ_MONOLITHIC_BUILD)
  69. AZ_DECLARE_MODULE_CLASS(Gem_MultiplayerSample_Client, MultiplayerSample::MultiplayerSampleModule);
  70. AZ_DECLARE_MODULE_CLASS(Gem_MultiplayerSample_Server, MultiplayerSample::MultiplayerSampleModule);
  71. #endif
  72. AZ_DECLARE_MODULE_CLASS(Gem_MultiplayerSample, MultiplayerSample::MultiplayerSampleModule)