TimeOfDay.h 909 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
  2. // Please see LICENSE.md in repository root for license information
  3. // https://github.com/AtomicGameEngine/AtomicGameEngine
  4. #pragma once
  5. #include "../Scene/Component.h"
  6. namespace Atomic
  7. {
  8. class TimeOfDay : public Component
  9. {
  10. OBJECT(TimeOfDay);
  11. /// Construct.
  12. TimeOfDay(Context* context);
  13. /// Destruct.
  14. virtual ~TimeOfDay();
  15. /// Register object factory.
  16. static void RegisterObject(Context* context);
  17. float GetTimeOn() const { return timeOn_; }
  18. float GetTimeOff() const { return timeOff_; }
  19. void SetTimeOn(float timeOn) { timeOn_ = timeOn; }
  20. void SetTimeOff(float timeOff) { timeOff_ = timeOff; }
  21. protected:
  22. void OnNodeSet(Node* node);
  23. void HandleSceneUpdate(StringHash eventType, VariantMap& eventData);
  24. private:
  25. float timeOn_;
  26. float timeOff_;
  27. bool on_;
  28. };
  29. }