EndConditions Class
Method Index
- _checkLoseGroup(hospital, lose_table, report)
- _checkWinGroup(hospital, win_table)
- _findBestWinGroup(hospital)
- _loadGoals(criteria_tbl, goals, start, win)
- checkEndGame(hospital)
- generateReportTable(hospital)
- getAttribute(hospital, attribute)
Member Index
- highest_group
- lose_goals
- win_goals
function EndConditions:EndConditions(level_config, level_number, freebuild)
Collect the end conditions for this level, if they exist
Parameters:
| Name | Type | Description |
|---|---|---|
| level_config | table | The map's level_config, containing criteria. |
| level_number | integer | The number of the map, if playing a campaign. |
| freebuild | boolean | The free build status of the world |
Declared on: line 50 of Lua/endconditions.lua.
function EndConditions:_checkLoseGroup(hospital, lose_table, report)
Parameters:
| Name | Type | Description |
|---|---|---|
| hospital | Hospital | The hospital of the tests. |
| lose_table | table | A group of lose conditions from level_config. |
| report | boolean | Whether a report table will be returned. |
Declared on: line 178 of Lua/endconditions.lua.
function EndConditions:_checkWinGroup(hospital, win_table)
Parameters:
| Name | Type | Description |
|---|---|---|
| hospital | Hospital | The hospital of the tests. |
| win_table | table | A group of win conditions from level_config |
Declared on: line 210 of Lua/endconditions.lua.
function EndConditions:_findBestWinGroup(hospital)
Find the group of win conditions best met by the hospital.
Parameters:
| Name | Type | Description |
|---|---|---|
| hospital | Hospital | The hospital of the tests. |
Declared on: line 228 of Lua/endconditions.lua.
function EndConditions:_loadGoals(criteria_tbl, goals, start, win)
Load conditions (goals) to win and lose from the level config,
and store them in self.win_goals and self.lose_goals in their groups.
Put the highest number of group of conditions in self.highest_group.
These groups are often incomplete, possibly empty
ie more groups of conditions that lead to loss than win.
Parameters:
| Name | Type | Description |
|---|---|---|
| criteria_tbl | table | The map's win or lose criteria. |
| goals | table | The class table to fill |
| start | table | The starting values of the hospital attributes |
| win | boolean | If the win goals are being filled this time |
Declared on: line 71 of Lua/endconditions.lua.
function EndConditions:checkEndGame(hospital)
Checks if the player has won or lost by meeting all of any one group.
Parameters:
| Name | Type | Description |
|---|---|---|
| hospital | Hospital | The hospital of the tests. |
Declared on: line 106 of Lua/endconditions.lua.
function EndConditions:generateReportTable(hospital)
Generate table for the Progress Report dialog and progress advice.
Parameters:
| Name | Type | Description |
|---|---|---|
| hospital | Hospital | The hospital of the tests. |
Declared on: line 130 of Lua/endconditions.lua.
function EndConditions:getAttribute(hospital, attribute)
Fetch the attribute value, through the get_custom_criteria table of
functions if there is one for this attribute.
Parameters:
| Name | Type | Description |
|---|---|---|
| hospital | ? | ? |
| attribute | ? | ? |
Declared on: line 243 of Lua/endconditions.lua.