Class: FoodUnit

FoodUnit


new FoodUnit()

Represents a package of unit you got delivered and subsequently stored in your restaurants. Game entity class.
Source:
FoodUnit.js

Members


units :Number

How many units are (still) in this package. Read-only.
Type:
  • Number
Source:
FoodUnit.js

food :String

The type of food in your package. Available as food is: SALAD, TOMATO, ONION, BREAD, LAMB_MEAT, CHICKEN_MEAT, BEEF_MEAT, CABBAGE, SPICES, GARLIC_SAUCE. Read-only.
Type:
  • String
Source:
FoodUnit.js

pullDate :Number

The best-use-before date represented as a number in days to go. Default 10. Read-only.
Type:
  • Number
Source:
FoodUnit.js

Methods


split(units)

Takes units out of this package and returns a new package with this amount.
Parameters:
Name Type Description
units Number Amount of units you want to have in the newly created FoodUnit
Source:
FoodUnit.js
Returns:
a newly created FoodUnit or null if units is larger than number of units available.
Type
FoodUnit

distributeEqually()

Splits this FoodUnit into as many as you have restaurants and sends one package to each restaurant. This FoodUnit has 0 units afterwards.
Source:
FoodUnit.js