Class: DailyStatistics

DailyStatistics


new DailyStatistics()

This class holds statistical information about the last business day. It is passed as a parameter to the doDaily callback of the company object.
Source:
DailyStatistics.js

Members


rottenUnits :Number

Returns the number of rotten units.
Type:
  • Number
Source:
DailyStatistics.js

servedUnits :Number

Returns the number of served units.
Type:
  • Number
Source:
DailyStatistics.js

guests :Number

Returns the number of guests in all of your restaurants.
Type:
  • Number
Source:
DailyStatistics.js

guestsTotal :Number

Returns the number of guests in all cities and all players.
Type:
  • Number
Source:
DailyStatistics.js

guestsLeft :Number

Returns the number of guest who left without ordering.
Type:
  • Number
Source:
DailyStatistics.js

guestsOutOfIng :Number

Returns the number of guests which got nothing as you ran out of ingredients.
Type:
  • Number
Source:
DailyStatistics.js

missingIngredients :Number

Returns the number of missing ingredients.
Type:
  • Number
Source:
DailyStatistics.js

Methods


getRottenUnitsPerFood(food)

Returns the number of rotten units for a given food
Parameters:
Name Type Description
food String (e.g. "CHICKEN_MEAT")
Source:
DailyStatistics.js
Returns:
the result
Type
Number

getServedUnitsPerMenu(menu)

Returns the number of served units for a given menu
Parameters:
Name Type Description
menu String (e.g. "Kebab")
Source:
DailyStatistics.js
Returns:
the result
Type
Number

getServedUnitsPerEstablishment(establishment)

Returns the number of served units for a given establishment
Parameters:
Name Type Description
establishment String (e.g. "Chippenham-1")
Source:
DailyStatistics.js
Returns:
the result
Type
Number

getGuestsTotalPerCity(city)

Returns the number of guests for all players in a given city
Parameters:
Name Type Description
city String (e.g. "Chippenham")
Source:
DailyStatistics.js
Returns:
the result
Type
Number

getGuestsPerEstablishment(establishment)

Returns the number of guests for a given establishment
Parameters:
Name Type Description
establishment String (e.g. "Chippenham-1")
Source:
DailyStatistics.js
Returns:
the result
Type
Number

getGuestsLeftPerEstablishment(establishment)

Returns the number of guests who left without ordering for a given establishment
Parameters:
Name Type Description
establishment String (e.g. "Chippenham-1")
Source:
DailyStatistics.js
Returns:
the result
Type
Number

getGuestsOutOfIngPerEstablishment(establishment)

Returns the number of guests who got nothing since you ran out of ingredients for a given establishment
Parameters:
Name Type Description
establishment String (e.g. "Chippenham-1")
Source:
DailyStatistics.js
Returns:
the result
Type
Number

getMissingIngredientsPerFood(food)

Returns the number of missing ingredients for a given food
Parameters:
Name Type Description
food String (e.g. "CHICKEN_MEAT")
Source:
DailyStatistics.js
Returns:
the result
Type
Number

getMissingIngredientsPerEstablishment(establishment)

Returns an object with food name and food total missing ingredients.
Parameters:
Name Type Description
establishment Establishment establishment object. (For backward compatibility an establishment address as string is also allowed)
Source:
DailyStatistics.js
Returns:
data object per food with method "get".
Example
company.establishments.each(function(est) {
  var data = stats.getMissingIngredientsPerEstablishment(est); 
  console.log("Missing bread in "+est.address+" = "+data.get("BREAD")); 
});