Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

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 Parameter
Cost extends Readonly<Partial<Record<ResourceKey, number>>>
Parameter Type
entity Entity
cost? KeyedCost<Cost>

ResourceKey | undefined