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

mapcreator git · master

SDL3 2.5D game and engine using assets, with map editor

sdl3 c++ game engine map-editor cmake · first commit 2025-10-31 · last commit 2026-09-07 (1 month ago) · synced 3 days ago · upstream: git.ide3.de/hsnr/sdl-spieleentwicklung/map_creator

C++ 99.3%
git clone https://git.christianimmanuel.de/sdl-graphics/mapcreator.gitwget https://git.christianimmanuel.de/sdl-graphics/mapcreator/archive/mapcreator.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();
}