Nimbin[12]?SDL & Graphics / mapcreator / src/resource/resource.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/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);
};