Nimbin[12]?SDL & Graphics / SDL_Game_CPP / src/resource/resource.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/resource/resource.hpp 913 B · 36 lines raw
#pragma once

#include "objects/object.hpp"
#include "resource/resource_data.hpp"

enum class ItemType : uint32_t ;

class Resource : public Object {
public:
    Resource(// OBJECT STUFF
             ObjectType ot,
             ObjectCategory oc,
             TileType tt,
             size_t ts_id,
             size_t tso_id,
             SDL_Point wtp,
             SDL_Point d,
             int zi,
             // RESOURCES
             ResourceType rt,
             unsigned qty,
             CollectingMethode m,
             float duration)
        : Object(ot, oc, tt, ts_id, tso_id, wtp, d, zi),
          resource(rt),
          quantity(qty),
          collecting_methode(m),
          collecting_duration(duration)
    {}

    ResourceType resource;
    unsigned     quantity;
    CollectingMethode collecting_methode;
    float        collecting_duration;
    bool is_Collectable(ItemType item);
};