Class: Company

Company

new Company()

This class represents your company. Game entity class. The game engine will create an instance under the name "company" for you.
This diagram shows the order and point in time when a particular function (you implemented) is called by the engine.

The number put in brackets defines the priority. The higher the priority the first it is called, e.g. on a day
which is the first of a month (but not the start of a week), the following methods will be called in that order: realEstateAgent, hiringProcess, doMonthly,
doDaily, foodDelivery.

Type:

cash :Number

Your cash money. You cannot spend more at any time. That means whenever you would need more money, you go bankrupt. The game start with 50,000. Read-only.

Type:

Number

Source:

Company.js

launch :function

CALLBACK METHOD! This gets called once at the start of the game. Implement your callback and assign it to this property.

Type:

function

Source:

Company.js

Example

company.launch = function() {
// things you want to do at the start of the game, e.g. define a menu
};

doDaily :function

CALLBACK METHOD! This gets called at the start of each day. Implement your callback and assign it to this property.

Type:

function

Source:

Company.js

Example

company.doDaily = function(dailyStatistics) {
// things you want to do each day, like ordering food
// (via company.grocer) or using
// dailyStatistics to look at last day's statistics.
};

doWeekly :function

CALLBACK METHOD! This gets called at the start of each week. Implement your callback and assign it to this property.

Type:

function

Source:

Company.js

Example

company.doWeekly = function() {
// things you want to do each week
};

doMonthly :function

CALLBACK METHOD! This gets called at the start of each month. Implement your callback and assign it to this property.

Type:

function

Source:

Company.js

Example

company.doMonthly = function() {
// things you want to do each month
};

realEstateAgent :function

CALLBACK METHOD! This gets called at the start of each month. Implement your callback and assign it to this property.

Type:

function

Source:

Company.js

Example

company.realEstateAgent = function(realEstateProfiles) {
// At the start of a month you can buy/rent new locations.
// Use realEstateProfiles to see what is available.
};

foodDelivery :function

CALLBACK METHOD! This gets called at the start of each day. Implement your callback and assign it to this property.

Type:

function

Source:

Company.js

Example

company.foodDelivery = function(foodDelivery) {
// Each day you get a food delivery and you need to make sure that
// all locations get what they need by using foodDelivery to
// distribute the fresh items.
};