1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- // {BEGIN_LICENSE}
- /*
- * 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
- *
- */
- // {END_LICENSE}
- #include <AzCore/Serialization/SerializeContext.h>
- #include "${Name}SystemComponent.h"
- #include <${Name}/${Name}TypeIds.h>
- namespace ${SanitizedCppName}
- {
- AZ_COMPONENT_IMPL(${SanitizedCppName}SystemComponent, "${SanitizedCppName}SystemComponent",
- ${SanitizedCppName}SystemComponentTypeId);
- void ${SanitizedCppName}SystemComponent::Reflect(AZ::ReflectContext* context)
- {
- if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
- {
- serializeContext->Class<${SanitizedCppName}SystemComponent, AZ::Component>()
- ->Version(0)
- ;
- }
- }
- void ${SanitizedCppName}SystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
- {
- provided.push_back(AZ_CRC_CE("${SanitizedCppName}Service"));
- }
- void ${SanitizedCppName}SystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
- {
- incompatible.push_back(AZ_CRC_CE("${SanitizedCppName}Service"));
- }
- void ${SanitizedCppName}SystemComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required)
- {
- }
- void ${SanitizedCppName}SystemComponent::GetDependentServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& dependent)
- {
- }
- ${SanitizedCppName}SystemComponent::${SanitizedCppName}SystemComponent()
- {
- if (${SanitizedCppName}Interface::Get() == nullptr)
- {
- ${SanitizedCppName}Interface::Register(this);
- }
- }
- ${SanitizedCppName}SystemComponent::~${SanitizedCppName}SystemComponent()
- {
- if (${SanitizedCppName}Interface::Get() == this)
- {
- ${SanitizedCppName}Interface::Unregister(this);
- }
- }
- void ${SanitizedCppName}SystemComponent::Init()
- {
- }
- void ${SanitizedCppName}SystemComponent::Activate()
- {
- ${SanitizedCppName}RequestBus::Handler::BusConnect();
- }
- void ${SanitizedCppName}SystemComponent::Deactivate()
- {
- ${SanitizedCppName}RequestBus::Handler::BusDisconnect();
- }
- }
|