#pragma once
#include "../../utils/color.h"
#include "screen.h"

#include <memory>

namespace quokka_gfx
{
class RendererManager;
//------------------------------------------------------------
class ScreenTransition
{
  static constexpr Color BackgroundColor{ 30, 30, 30 };

  public:
  enum class State : uint8_t
  {
    None,
    TransitioningIn,
    TransitioningOut
  };

  public:
  ScreenTransition()                                       = delete;      // Default constructor
  virtual ~ScreenTransition()                              = default;     // Default destructor
  ScreenTransition(const ScreenTransition &obj)            = delete;      // Copy constructor
  ScreenTransition(ScreenTransition &&obj)                 = delete;      // Move constructor
  ScreenTransition &operator=(const ScreenTransition &obj) = delete;      // Copy assignment operator
  ScreenTransition &operator=(ScreenTransition &&obj)      = delete;      // Move assignment operator

  explicit ScreenTransition(ScreenManager *screenManager);     // Constructor

  // void setScreen(std::unique_ptr<Screen> screen);      // Set the current screen, replacing any existing screens on the stack
  // void pushScreen(std::unique_ptr<Screen> screen);     // Push a new screen onto the stack
  // void popScreen();                                    // Pop the current screen from the stack

  [[nodiscard]] State getState() const;        // Get the current state of the screen transition
  [[nodiscard]] float getProgress() const;     // Get the progress of the screen transition (0.0 to 1.0)

  void update(double deltaTime);              // Manage the transition between screens, updating the current screen
  void render(RendererManager *renderer);     // Render the transition between screens, rendering the current screen

  //[[nodiscard]] Screen *getCurrentScreen() const;     // Get the current screen

  protected:
  ScreenManager *m_screenManager = nullptr;     // Pointer to the screen manager

  State m_state    = State::None;     // Current state of the screen transition
  float m_progress = 0.0f;            // Progress of the screen transition (0.0 to 1.0)
};
//------------------------------------------------------------
}     // namespace quokka_gfx
