#ifndef INGAME_STATE_H
#define INGAME_STATE_H

#include "../entities/Opponent.h"
#include "GameState.h"
#include <vector>
#include <SDL2/SDL_image.h>

enum class Type {
    HEALTH,
    DAMAGE
};

struct Item {
    int x;
    int y;

    Type type;
};

class InGameState final : public GameState {
    Player player;
    std::vector<Opponent> opponents;
    std::vector<Item> items;
    int startTime = 0;

    bool showHitboxes = false;

    void renderPlayer(SDL_Renderer* renderer, SDL_Texture* player, Player p) const;

public:
    void init() override;
    void handleEvents(SDL_Event& event) override;
    void update() override;
    void render(SDL_Renderer* renderer) override;

    void spawnItem(Type type);
    void createOpponent();
    void checkCollision();
    void renderHUD(SDL_Renderer* renderer, SDL_Texture* heart) const;
    void renderItem(SDL_Renderer* renderer, Item i) const;
    void renderOpponent(SDL_Renderer* renderer, SDL_Texture* opponentTexture, Opponent o) const;

};

#endif