Codechange: use GSCompanyMode::IsValid, IsDeity, and the precondition helpers

Direct 1:1 replacements in the code, and comments now refer to either
GSCompanyMode::IsValid or GSCompanyMode::IsDeity instead of several variations
on "company mode active" or "no company mode active".
This commit is contained in:
Rubidium
2023-03-02 19:44:13 +01:00
committed by rubidium42
parent cada2ca310
commit 83946ca31d
46 changed files with 227 additions and 226 deletions

View File

@@ -71,7 +71,7 @@ public:
* @param header The optional header text for the table (null is allowed).
* @param footer The optional footer text for the table (null is allowed).
* @return The new LeagueTableID, or LEAGUE_TABLE_INVALID if it failed.
* @pre No ScriptCompanyMode may be in scope.
* @pre ScriptCompanyMode::IsDeity.
* @pre title != null && len(title) != 0.
*/
static LeagueTableID New(Text *title, Text *header, Text *footer);
@@ -86,7 +86,7 @@ public:
* @param link_type Type of the referenced object.
* @param link_target Id of the referenced object.
* @return The new LeagueTableElementID, or LEAGUE_TABLE_ELEMENT_INVALID if it failed.
* @pre No ScriptCompanyMode may be in scope.
* @pre ScriptCompanyMode::IsDeity.
* @pre IsValidLeagueTable(table).
* @pre text != null && len(text) != 0.
* @pre score != null && len(score) != 0.
@@ -102,7 +102,7 @@ public:
* @param link_type Type of the referenced object.
* @param link_target Id of the referenced object.
* @return True if the action succeeded.
* @pre No ScriptCompanyMode may be in scope.
* @pre ScriptCompanyMode::IsDeity.
* @pre IsValidLeagueTableElement(element).
* @pre text != null && len(text) != 0.
* @pre IsValidLink(Link(link_type, link_target)).
@@ -115,7 +115,7 @@ public:
* @param rating Value that elements are ordered by.
* @param score String representation of the score associated with the element (can be either a raw string, or ScriptText object).
* @return True if the action succeeded.
* @pre No ScriptCompanyMode may be in scope.
* @pre ScriptCompanyMode::IsDeity.
* @pre IsValidLeagueTableElement(element).
* @pre score != null && len(score) != 0.
*/
@@ -126,7 +126,7 @@ public:
* Remove a league table element.
* @param element Id of the element to update
* @return True if the action succeeded.
* @pre No ScriptCompanyMode may be in scope.
* @pre ScriptCompanyMode::IsDeity.
* @pre IsValidLeagueTableElement(element).
*/
static bool RemoveElement(LeagueTableElementID element);