create_deposit

Function create_deposit 

Source
pub fn create_deposit<S: State, T: Action<S, bool>>(
    ctx: &mut NpcCtx<'_, '_>,
    item: ItemResource,
    amount: f32,
    then: T,
) -> Option<impl Action<S, bool> + use<S, T>>
Expand description

Perform a deposit check, ensuring that the NPC has the given item and amount in their inventory. If they do, the provided action is performed to determine whether we should proceed. If the action chooses to proceed, then we attempt to remove the items from the inventory. This may be fallible.