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

  1. UCResourceManager is a UGameInstanceSubsystem registered as a singleton via CNAME_Singleton_ResourceManager. It stores a TMap<FName, float> resourceMap for named resource quantities and a TMap<FName, UObject*> mecanikMap for game mechanic objects (e.g. the deck).
  2. Resource operations (supply, consume, setupAny/All, removeAny/All) modify resourceMap and broadcast onResourceEvent so listeners (implementing ICResourceBoundable) are notified.
  3. consume and supply also resolve the resource’s UClass from a FCResourceStruct DataTable row via the coordinator.
  4. The deck mechanic is registered into mecanikMap via UCDeckMecanikBPLibrary::registerDeckMecanik, which loads game and player decks from DataTables into a UCGameCardArea object.
  5. Card operations (draw, move, shuffle, complete hand/river) are exposed as static Blueprint functions in UCDeckMecanikBPLibrary.
  6. ResourceUtility (in CCOREUMODULE) provides static helpers to access consume/supply/event binding from anywhere without direct manager access.