PlayerArmorComponent.h 937 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * 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.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0 OR MIT
  5. *
  6. */
  7. #pragma once
  8. #include <Source/AutoGen/PlayerArmorComponent.AutoComponent.h>
  9. namespace MultiplayerSample
  10. {
  11. class PlayerArmorComponentController
  12. : public PlayerArmorComponentControllerBase
  13. {
  14. public:
  15. explicit PlayerArmorComponentController(PlayerArmorComponent& parent);
  16. void OnActivate(Multiplayer::EntityIsMigrating entityIsMigrating) override;
  17. void OnDeactivate(Multiplayer::EntityIsMigrating entityIsMigrating) override;
  18. private:
  19. void OnAmountChanged(float armor);
  20. AZ::Event<float>::Handler m_changedHandler{ [this](float armor)
  21. {
  22. OnAmountChanged(armor);
  23. } };
  24. float m_previousArmorAmount = 0.f;
  25. };
  26. }