/* * 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 #include namespace AZ { class ReflectContext; namespace SceneAPI { namespace Containers { class RuleContainer { public: AZ_RTTI(RuleContainer, "{2C20D3DF-57FF-4A31-8680-A4D45302B9CF}"); virtual ~RuleContainer() {} SCENE_CORE_API size_t GetRuleCount() const; SCENE_CORE_API AZStd::shared_ptr GetRule(size_t index) const; /** * Find the first rule of the template type. * @result The first rule of the template type. nullptr if not found. */ template AZStd::shared_ptr FindFirstByType() const; /** * Check if there is a rule of the given template type. * @result True in case a rule of the given template type got found, false if not. */ template bool ContainsRuleOfType() const; SCENE_CORE_API void AddRule(const AZStd::shared_ptr& rule); SCENE_CORE_API void AddRule(AZStd::shared_ptr&& rule); SCENE_CORE_API void RemoveRule(size_t index); SCENE_CORE_API void RemoveRule(const AZStd::shared_ptr& rule); static void Reflect(ReflectContext* context); static SCENE_CORE_API bool VectorToRuleContainerConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement); private: AZStd::vector> m_rules; }; } // Containers } // SceneAPI } // AZ #include