Class: Grocer

Grocer


new Grocer()

Your grocer to order food. Available food is: SALAD, TOMATO, ONION, BREAD, LAMB_MEAT, CHICKEN_MEAT, BEEF_MEAT, CABBAGE, SPICES, GARLIC_SAUCE. Game entity class.
Source:
Grocer.js

Methods


getPrice(food, units)

Returns the current price for a particular amount of food. The more you buy the cheaper it gets.
Parameters:
Name Type Description
food String Type of food you want to check
units Number Number of units you want to check
Source:
Grocer.js
Returns:
the current price for this package
Type
Number

order(food, units)

Orders a package of food for this day
Parameters:
Name Type Description
food String Type of food you want to buy
units Number Number of units you want to order
Source:
Grocer.js

bulkOrder(food, units, days)

Orders one package each day of food for the next days
Parameters:
Name Type Description
food String Type of food you want to buy
units Number Number of units you want to order each day
days Number number of days
Source:
Grocer.js