CRESOURCEUMODULE
Overview
The CRESOURCEUMODULE is a resource management system that handles named resource inventories and a card deck mechanic. It provides a UGameInstanceSubsystem for tracking resource quantities by name, with supply/consume operations and event broadcasting. On top of that, a deck mechanic (UCGameCardArea) can be registered to manage card-based gameplay (draw, discard, river, hand).
Depends on CCOREUMODULE.
| Functionalities | Overview |
|---|---|
| CResourceManager | UCResourceManager subsystem: named resource inventory with supply, consume, count, setup and remove operations. Broadcasts onResourceEvent on every change |
| Data | FCResourceStruct and FCResourceMetadataStruct DataTable row structures for resource definitions |
| Deck | Card deck mechanic: UCGameCardArea, UCCard, FCCardRowBase, FCPlayerCardArea, FCRoomExchange for deck/hand/river/discard management |
| Blueprint | Blueprint-callable functions on UCResourceManager and UCDeckMecanikBPLibrary for resource and deck operations |
Architecture
UCResourceManageris aUGameInstanceSubsystemregistered as a singleton viaCNAME_Singleton_ResourceManager. It stores aTMap<FName, float> resourceMapfor named resource quantities and aTMap<FName, UObject*> mecanikMapfor game mechanic objects (e.g. the deck).- Resource operations (
supply,consume,setupAny/All,removeAny/All) modifyresourceMapand broadcastonResourceEventso listeners (implementingICResourceBoundable) are notified. consumeandsupplyalso resolve the resource’sUClassfrom aFCResourceStructDataTable row via the coordinator.- The deck mechanic is registered into
mecanikMapviaUCDeckMecanikBPLibrary::registerDeckMecanik, which loads game and player decks from DataTables into aUCGameCardAreaobject. - Card operations (draw, move, shuffle, complete hand/river) are exposed as static Blueprint functions in
UCDeckMecanikBPLibrary. ResourceUtility(inCCOREUMODULE) provides static helpers to access consume/supply/event binding from anywhere without direct manager access.