You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
2.2 KiB
C++
64 lines
2.2 KiB
C++
/*
|
|
* 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
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "ScriptEventsBus.h"
|
|
#include "ScriptEvent.h"
|
|
|
|
namespace ScriptEvents
|
|
{
|
|
class ScriptEventsSystemComponentImpl
|
|
: protected ScriptEventBus::Handler
|
|
{
|
|
public:
|
|
AZ_CLASS_ALLOCATOR(ScriptEventsSystemComponentImpl, AZ::SystemAllocator, 0);
|
|
|
|
ScriptEventsSystemComponentImpl()
|
|
{
|
|
ScriptEventBus::Handler::BusConnect();
|
|
}
|
|
|
|
~ScriptEventsSystemComponentImpl()
|
|
{
|
|
ScriptEventBus::Handler::BusDisconnect();
|
|
}
|
|
|
|
virtual void RegisterAssetHandler() = 0;
|
|
virtual void UnregisterAssetHandler() = 0;
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
// ScriptEvents::ScriptEventBus::Handler
|
|
AZStd::intrusive_ptr<Internal::ScriptEventRegistration> RegisterScriptEvent(const AZ::Data::AssetId& assetId, AZ::u32 version) override;
|
|
void RegisterScriptEventFromDefinition(const ScriptEvents::ScriptEvent& definition) override;
|
|
void UnregisterScriptEventFromDefinition(const ScriptEvents::ScriptEvent& definition) override;
|
|
AZStd::intrusive_ptr<Internal::ScriptEventRegistration> GetScriptEvent(const AZ::Data::AssetId& assetId, AZ::u32 version) override;
|
|
const FundamentalTypes* GetFundamentalTypes() override;
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
private:
|
|
|
|
// Script Event Assets
|
|
AZStd::unordered_map<ScriptEventKey, AZStd::intrusive_ptr<ScriptEvents::Internal::ScriptEventRegistration>> m_scriptEvents;
|
|
|
|
FundamentalTypes m_fundamentalTypes;
|
|
|
|
};
|
|
|
|
class ScriptEventModuleConfigurationRequests : public AZ::EBusTraits
|
|
{
|
|
public:
|
|
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
|
|
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
|
|
|
virtual ScriptEventsSystemComponentImpl* GetSystemComponentImpl() = 0;
|
|
};
|
|
using ScriptEventModuleConfigurationRequestBus = AZ::EBus< ScriptEventModuleConfigurationRequests>;
|
|
|
|
}
|