/* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. * * For complete copyright and license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license below or the license accompanying this file. Do not * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ #pragma once #include #include #include #include namespace GraphCanvas { //! Manages all of the state required by scene members class SceneMemberComponent : public AZ::Component , public SceneMemberRequestBus::Handler , public GroupableSceneMemberRequestBus::Handler , public AZ::EntityBus::Handler { public: AZ_COMPONENT(SceneMemberComponent, "{C431F18F-22FB-4D3E-8E1A-2F8E4E30F7FB}"); static void Reflect(AZ::ReflectContext* reflectContext); SceneMemberComponent(); explicit SceneMemberComponent(bool isGroupable); ~SceneMemberComponent() = default; // AZ::Component void Init() override; void Activate() override; void Deactivate() override; //// // SceneMemberRequestBus void SetScene(const AZ::EntityId& sceneId) override; void ClearScene(const AZ::EntityId& sceneId) override; void SignalMemberSetupComplete() override; AZ::EntityId GetScene() const override; bool IsGrouped() const override; const AZ::EntityId& GetGroupId() const override; void RegisterToGroup(const AZ::EntityId& groupId) override; void UnregisterFromGroup(const AZ::EntityId& groupId) override; void RemoveFromGroup() override; //// // EntityBus void OnEntityExists(const AZ::EntityId&) override; //// private: bool m_isGroupable; AZ::EntityId m_sceneId; AZ::EntityId m_groupId; }; }