SimulationFeaturesAggregator.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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/Component/Component.h>
  10. #include <AzCore/Component/TickBus.h>
  11. #include <AzCore/Script/ScriptTimePoint.h>
  12. #include <AzFramework/Entity/EntityContextBus.h>
  13. #include <AzFramework/Physics/PhysicsScene.h>
  14. #include <AzFramework/Spawnable/SpawnableEntitiesInterface.h>
  15. #include <SimulationInterfaces/SimulationFeaturesAggregatorRequestBus.h>
  16. namespace SimulationInterfaces
  17. {
  18. class SimulationFeaturesAggregator
  19. : public AZ::Component
  20. , protected SimulationFeaturesAggregatorRequestBus::Handler
  21. {
  22. public:
  23. AZ_COMPONENT_DECL(SimulationFeaturesAggregator);
  24. static void Reflect(AZ::ReflectContext* context);
  25. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  26. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  27. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  28. static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
  29. SimulationFeaturesAggregator();
  30. ~SimulationFeaturesAggregator();
  31. // AZ::Component
  32. void Activate() override;
  33. void Deactivate() override;
  34. private:
  35. // SimulationFeaturesAggregatorRequestBus overrides
  36. void AddSimulationFeatures(const AZStd::unordered_set<SimulationFeatureType>& features) override;
  37. AZStd::unordered_set<SimulationFeatureType> GetSimulationFeatures() override;
  38. bool HasFeature(SimulationFeatureType feature) override;
  39. AZStd::unordered_set<SimulationFeatureType> m_registeredFeatures;
  40. };
  41. } // namespace SimulationInterfaces