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:
@@ -30,7 +30,7 @@
|
||||
CCountedPtr<Text> header_counter(header);
|
||||
CCountedPtr<Text> footer_counter(footer);
|
||||
|
||||
EnforcePrecondition(LEAGUE_TABLE_INVALID, ScriptObject::GetCompany() == OWNER_DEITY);
|
||||
EnforceDeityMode(LEAGUE_TABLE_INVALID);
|
||||
EnforcePrecondition(LEAGUE_TABLE_INVALID, title != nullptr);
|
||||
const std::string &encoded_title = title->GetEncodedText();
|
||||
EnforcePreconditionEncodedText(LEAGUE_TABLE_INVALID, encoded_title);
|
||||
@@ -54,7 +54,7 @@
|
||||
CCountedPtr<Text> text_counter(text);
|
||||
CCountedPtr<Text> score_counter(score);
|
||||
|
||||
EnforcePrecondition(LEAGUE_TABLE_ELEMENT_INVALID, ScriptObject::GetCompany() == OWNER_DEITY);
|
||||
EnforceDeityMode(LEAGUE_TABLE_ELEMENT_INVALID);
|
||||
|
||||
EnforcePrecondition(LEAGUE_TABLE_ELEMENT_INVALID, IsValidLeagueTable(table));
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
{
|
||||
CCountedPtr<Text> text_counter(text);
|
||||
|
||||
EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY);
|
||||
EnforceDeityMode(false);
|
||||
EnforcePrecondition(false, IsValidLeagueTableElement(element));
|
||||
|
||||
EnforcePrecondition(false, company == ScriptCompany::COMPANY_INVALID || ScriptCompany::ResolveCompanyID(company) != ScriptCompany::COMPANY_INVALID);
|
||||
@@ -102,7 +102,7 @@
|
||||
{
|
||||
CCountedPtr<Text> score_counter(score);
|
||||
|
||||
EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY);
|
||||
EnforceDeityMode(false);
|
||||
EnforcePrecondition(false, IsValidLeagueTableElement(element));
|
||||
|
||||
EnforcePrecondition(false, score != nullptr);
|
||||
@@ -114,7 +114,7 @@
|
||||
|
||||
/* static */ bool ScriptLeagueTable::RemoveElement(LeagueTableElementID element)
|
||||
{
|
||||
EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY);
|
||||
EnforceDeityMode(false);
|
||||
EnforcePrecondition(false, IsValidLeagueTableElement(element));
|
||||
|
||||
return ScriptObject::Command<CMD_REMOVE_LEAGUE_TABLE_ELEMENT>::Do(element);
|
||||
|
Reference in New Issue
Block a user