UiRestBetweenRoundsComponent.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 <MultiplayerSampleTypes.h>
  9. #include <AzCore/Component/Component.h>
  10. #include <AzCore/Component/TickBus.h>
  11. namespace MultiplayerSample
  12. {
  13. class UiRestBetweenRoundsComponent
  14. : public AZ::Component
  15. , public AZ::TickBus::Handler
  16. {
  17. public:
  18. AZ_COMPONENT(UiRestBetweenRoundsComponent, "{8BF185B2-DCE7-462B-B151-43E0AF717BA5}");
  19. static void Reflect(AZ::ReflectContext* context);
  20. void Activate() override;
  21. void Deactivate() override;
  22. //! AZ::TickBus::Handler overrides...
  23. void OnTick(float deltaTime, AZ::ScriptTimePoint time) override;
  24. private:
  25. void OnRoundRestTimeRemainingChanged(RoundTimeSec secondsRemaining);
  26. AZ::Event<RoundTimeSec>::Handler onRestTimeChangedHandler{ [this](RoundTimeSec secondsRemaining)
  27. {
  28. OnRoundRestTimeRemainingChanged(secondsRemaining);
  29. } };
  30. AZ::EntityId m_restTimerRootUiElement;
  31. AZ::EntityId m_numbersContainerUiElement;
  32. };
  33. }