checkCost
checkCost<
Cost>(entity,cost?):ResourceKey|undefined
Checks that entity can pay cost: the name of the first resource in
it that she has too little of to spend, and undefined where she can pay
it all. One she lacks is short. As Unreal’s ability system names its
CheckCost.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Cost extends Readonly<Partial<Record<ResourceKey, number>>> |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
entity |
Entity |
cost? |
KeyedCost<Cost> |
Returns
Section titled “Returns”ResourceKey | undefined