Skip to content

SeinARTS Resource Library

Class · USeinResourceBPFL : UBlueprintFunctionLibrary

#include "Lib/SeinResourceBPFL.h"

deterministic: safe in simulation code

Nodes for player resources: balances and caps, affordability, spending, refunds, income and transfers between players.

Get the current balance of a tagged resource for a player. Returns Zero on invalid player / missing entry.

static FFixedPoint SeinGetResource(const UObject* WorldContextObject, FSeinPlayerID PlayerID, FGameplayTag ResourceTag);

Returns the player’s full resource map. Empty on invalid player.

static TMap<FGameplayTag, FFixedPoint> SeinGetAllResources(const UObject* WorldContextObject, FSeinPlayerID PlayerID);

Returns the cap for a resource (per-player override if set, else catalog default). FFixedPoint::Zero means uncapped.

static FFixedPoint SeinGetResourceCap(const UObject* WorldContextObject, FSeinPlayerID PlayerID, FGameplayTag ResourceTag);

Returns true if the player can afford the full cost. Uses the resource’s CostDirection (DeductFromBalance vs AddTowardCap) when consulting each entry. Invalid tags, negative amounts, and fixed-point overflow/underflow fail closed before mutation.

static bool SeinCanAfford(const UObject* WorldContextObject, FSeinPlayerID PlayerID, const FSeinResourceCost& Cost);

Split a cost map into AtEnqueue / AtCompletion buckets according to each resource’s ProductionDeductionTiming in the catalog. Ability activation consults this only when its explicit cost timing is Production Queue.

Resources whose tag is not found in the catalog default to AtEnqueue — fail-safe for partially-authored projects. Empty input → both outputs empty.

static void SeinSplitCostByCatalog(const UObject* WorldContextObject, const FSeinResourceCost& InCost, FSeinResourceCost& OutAtEnqueueCost, FSeinResourceCost& OutAtCompletionCost);

Deducts the full cost if affordable. Returns false (no changes) on invalid player or insufficient balance. Uses CostDirection to decide the math per entry.

static bool SeinDeduct(const UObject* WorldContextObject, FSeinPlayerID PlayerID, const FSeinResourceCost& Cost);

Refunds a cost back to the player. No affordability gate — always applied. Honors cap: excess clamps per catalog overflow behavior.

static void SeinRefund(const UObject* WorldContextObject, FSeinPlayerID PlayerID, const FSeinResourceCost& Cost);

One-shot income grant (ability drop, scavenge loot, tech completion bonus). Applies cap-overflow policy and saturates uncapped numeric overflow at FFixedPoint::MaxValue. Invalid tags or negative amounts reject the entire grant without changing balances.

static void SeinGrantIncome(const UObject* WorldContextObject, FSeinPlayerID PlayerID, const FSeinResourceCost& Amount);

Transfer resources from one player to another. Returns false on invalid players or insufficient balance. Always permits the transfer when affordable — gating (alliance rules, mid-match transfer locks, etc.) is designer-authored at the caller. Wrap this node in a project-side BP graph that checks your project’s policy before invoking.

static bool SeinTransfer(const UObject* WorldContextObject, FSeinPlayerID FromPlayer, FSeinPlayerID ToPlayer, const FSeinResourceCost& Amount);
C++ members (1)
  • static bool SeinTryReverseDeduction(const UObject* WorldContextObject, FSeinPlayerID PlayerID, const FSeinResourceCost& Cost); Exactly reverses a prior successful Deduct operation. Unlike the general Refund/income operation, this intentionally bypasses caps so cancellation cannot lose committed value if unrelated income arrived meanwhile. Fails atomically on invalid cost data, a missing player, or fixed-point overflow.