123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- /*
- * 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 <Source/AutoGen/EnergyCannonComponent.AutoComponent.h>
- namespace MultiplayerSample
- {
- class EnergyCannonComponent
- : public EnergyCannonComponentBase
- {
- public:
- AZ_MULTIPLAYER_COMPONENT(MultiplayerSample::EnergyCannonComponent, s_energyCannonComponentConcreteUuid, MultiplayerSample::EnergyCannonComponentBase);
- static void Reflect(AZ::ReflectContext* context);
- void OnActivate(Multiplayer::EntityIsMigrating entityIsMigrating) override;
- void OnDeactivate(Multiplayer::EntityIsMigrating entityIsMigrating) override;
- #if AZ_TRAIT_CLIENT
- void HandleRPC_TriggerBuildup(AzNetworking::IConnection* invokingConnection) override;
- #endif
- // Invoked directly by the energy ball projectile component on the client
- void KillBuildupEffect() const;
- private:
- GameEffect m_effect;
- };
- class EnergyCannonComponentController
- : public EnergyCannonComponentControllerBase
- {
- public:
- explicit EnergyCannonComponentController(EnergyCannonComponent& parent);
- void OnActivate(Multiplayer::EntityIsMigrating entityIsMigrating) override;
- void OnDeactivate(Multiplayer::EntityIsMigrating entityIsMigrating) override;
- #if AZ_TRAIT_SERVER
- private:
- void OnTriggerBuildup();
- AZ::ScheduledEvent m_triggerBuildupEvent{ [this]()
- {
- OnTriggerBuildup();
- }, AZ::Name("BuildupEnergyCannon") };
- void OnFireEnergyBall();
- AZ::ScheduledEvent m_firingEvent{[this]()
- {
- OnFireEnergyBall();
- }, AZ::Name("FireEnergyCannon")};
- #endif
- };
- }
|