CorsixTH Lua Documentation

EndConditions Class

Declared on: line 46 of Lua/endconditions.lua.

Method Index

Member Index

function EndConditions:EndConditions(level_config, level_number, freebuild)

Collect the end conditions for this level, if they exist

Parameters:

NameTypeDescription
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:

NameTypeDescription
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:

NameTypeDescription
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:

NameTypeDescription
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:

NameTypeDescription
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:

NameTypeDescription
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:

NameTypeDescription
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:

NameTypeDescription
hospital ? ?
attribute ? ?

Declared on: line 243 of Lua/endconditions.lua.