withdrawAmount

fun withdrawAmount(filter: Filter<Item>, amount: Bank.Amount): Int
fun withdrawAmount(filter: Filter<Item>, amount: Int): Int

Withdraws the specified amount of the specified item.

Return

the amount successfully withdrawn

Parameters

filter

the filter to apply to the items. If multiple items matching the filter exist, only the first is withdrawn

amount

the amount to withdraw

fun withdrawAmount(name: String, amount: Bank.Amount): Int
fun withdrawAmount(name: String, amount: Int): Int

Withdraws the specified amount of the specified item.

Return

the amount successfully withdrawn

Parameters

name

the name of the item to withdraw. If multiple items with the same name exist, only the first is withdrawn

amount

the amount to withdraw

fun withdrawAmount(id: Int, amount: Bank.Amount): Int
fun withdrawAmount(id: Int, amount: Int): Int

Withdraws the specified amount of the specified item.

Return

the amount successfully withdrawn

Parameters

id

the id of the item to withdraw

amount

the amount to withdraw

fun withdrawAmount(item: Item, amount: Int): Int

Withdraws the specified amount of the specified item.

Return

the amount successfully withdrawn

Parameters

item

the item to withdraw

amount

the amount to withdraw