Nimbin[12]?SDL & Graphics / SDL_Game_CPP / src/building/research.hpp

SDL_Game_CPP git · main

SDL game in C++

sdl game c++ · first commit 2026-03-24 · last commit 2026-03-24 (8 months ago) · synced 1 hour ago · upstream: codeberg.org/Studying_at_HsNR/SDL_Game_CPP

C++ 99.3%
git clone https://git.christianimmanuel.de/sdl-graphics/SDL_Game_CPP.gitwget https://git.christianimmanuel.de/sdl-graphics/SDL_Game_CPP/archive/SDL_Game_CPP.tar.gz
src/building/research.hpp 1.1 KB · 43 lines raw
#pragma once

#include "building/building_data.hpp"
#include "inventory/item.hpp"


struct Researching {
    BuildingType b_type = BuildingType::NONE;
    BuildingData_s b_stats = {};
    ItemType i_type = ItemType::NONE;
    ItemStats i_stats = {};
    float duration = 0;
    bool is_researching = false;
};


namespace Research {

    extern bool is_researching;
    extern Researching research_item;


    extern std::vector<BuildingType>
        research_buildings;
    extern std::vector<ItemType>
        research_items;

    void
    draw_ReserachMenu(SDL_Renderer*, SDL_Rect win_size, BuildingType type, std::vector<bool>& researched_buildings, std::vector<bool>& researched_items, bool hovering_research_button);
    bool
    is_CursorOverMenuInfoPanel(const SDL_FPoint mouse_pos);
    bool
    cursor_OverResearchButton(const SDL_FPoint mouse_pos);
    int
    cursor_ResearchGridTileIndex(SDL_FPoint mouse, SDL_Rect win_size);

    bool
    research_Start();
    bool
    research_Continue(std::vector<bool>& researched_buildings, std::vector<bool>& researched_items);
    void
    research_Stop();
}