/* * 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. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #include "AttributeFloat.h" #include "AttributeInt32.h" #include "AttributeBool.h" #include namespace MCore { AZ_CLASS_ALLOCATOR_IMPL(AttributeFloat, AttributeAllocator, 0) bool AttributeFloat::InitFrom(const Attribute* other) { switch (other->GetType()) { case TYPE_ID: m_value = static_cast(other)->GetValue(); return true; case MCore::AttributeBool::TYPE_ID: m_value = static_cast(other)->GetValue(); return true; case MCore::AttributeInt32::TYPE_ID: m_value = static_cast(static_cast(other)->GetValue()); return true; default: return false; } } } // namespace MCore