#pragma once

#include <SDL3/SDL.h>

#include "render/canvas.hpp"
#include "resources.hpp"

#if DEBUG
#include "developer/window.hpp"
#endif

#include "state/play.hpp"
#include "state/select.hpp"

#include "entity.hpp"

namespace game
{
  class State
  {
  public:
    SDL_Window* window{};
    SDL_GLContext context{};
    Uint64 previousUpdate{};

    enum Type
    {
      PLAY,
      SELECT
    };

    Type type{SELECT};

    Resources resources;

    state::Play play;
    state::Select select;
#if DEBUG
    developer::Window developerWindow;
#endif

    void update();
    void render();

    bool isRunning{true};
    bool isCursorHidden{};

    Canvas canvas{};

    State(SDL_Window*, SDL_GLContext, resource::xml::Schema);
    void loop();
  };
};
