PropertySlotComponent.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 <Components/Slots/SlotComponent.h>
  10. #include <GraphCanvas/Components/Slots/Property/PropertySlotBus.h>
  11. namespace GraphCanvas
  12. {
  13. class PropertySlotComponent
  14. : public SlotComponent
  15. , public PropertySlotRequestBus::Handler
  16. {
  17. public:
  18. AZ_COMPONENT(PropertySlotComponent, "{72D2C614-0E1C-4048-9382-4BBA4B25C66F}", SlotComponent);
  19. static void Reflect(AZ::ReflectContext* reflectContext);
  20. static AZ::Entity* CreatePropertySlot(const AZ::EntityId& nodeId, const AZ::Crc32& propertyId, const SlotConfiguration& slotConfiguration);
  21. PropertySlotComponent();
  22. PropertySlotComponent(const AZ::Crc32& propertyId, const SlotConfiguration& slotConfiguration);
  23. ~PropertySlotComponent();
  24. // Component
  25. void Init() override;
  26. void Activate() override;
  27. void Deactivate() override;
  28. ////
  29. // Slot RequestBus
  30. int GetLayoutPriority() const override;
  31. void SetLayoutPriority(int priority) override;
  32. ////
  33. // PropertySlotBus
  34. const AZ::Crc32& GetPropertyId() const override;
  35. ////
  36. private:
  37. PropertySlotComponent(const PropertySlotComponent&) = delete;
  38. PropertySlotComponent& operator=(const PropertySlotComponent&) = delete;
  39. AZ::Entity* ConstructConnectionEntity(const Endpoint& sourceEndpoint, const Endpoint& targetEndpoint, bool createModelConnection) override;
  40. AZ::Crc32 m_propertyId;
  41. };
  42. }