The current state of the Vendotron.
More...
|
|
| message = None |
| | The message currently displayed.
|
| |
|
| currencies = Currency.currency_list(0b111101011101) |
| | A list of acceptable Currencies.
|
| |
|
| payment = None |
| | Frequencies of payments that have been made.
|
| |
|
| balance = None |
| | Total balance.
|
| |
|
bool | RUNNING = False |
| | Indicates if the Vendotron is currently running.
|
| |
|
| epoch = time.time() |
| | Timestamp of the state change.
|
| |
The current state of the Vendotron.
◆ dispense_drink()
| def Vendotron.State.dispense_drink |
( |
|
drink | ) |
|
|
static |
Dispense a drink.
Dispense a drink and deduct the drink's cost from the balance. If there is any leftover prompt the user to buy another.
◆ drink_select()
| def Vendotron.State.drink_select |
( |
|
drink | ) |
|
|
static |
Dispense a drink if the balance is high enough, otherwise display the price.
- Parameters
-
| drink | The drink to attempt to purchase |
◆ eject()
| def Vendotron.State.eject |
( |
| ) |
|
|
static |
Return the current balance to the user in the fewest number of coins possible.
- Returns
- A dictionary containing quantities of each currency where keys are the currency value and values are the frequency of each denomination.
◆ initialize()
| def Vendotron.State.initialize |
( |
| ) |
|
|
static |
(Re)initialize the vendotron to its starting state.
Set the frequency of all payments and balance to zero, display the welcome message, and set RUNNING to True.
◆ insert_currency()
| def Vendotron.State.insert_currency |
( |
|
index | ) |
|
|
static |
Insert one Currency into the Vendotron and display the current balance.
- Parameters
-
| index | The index in the currencies list of which currency is being inserted |
The documentation for this class was generated from the following file: