Add: GSCompanyMode::IsValid and IsDeity, and precondition enforcement helpers

This commit is contained in:
Rubidium
2023-03-02 19:44:13 +01:00
committed by rubidium42
parent 665a73b3c7
commit cada2ca310
4 changed files with 43 additions and 0 deletions

View File

@@ -47,6 +47,22 @@ public:
* in when the instance was created.
*/
~ScriptCompanyMode();
/**
* Check whether a company mode is valid. In other words, are commands
* being executed under some company.
* @return true When a company mode is valid.
* @post !ScriptCompanyMode::IsDeity().
*/
static bool IsValid();
/**
* Check whether the company mode is not active, i.e. whether we are a deity.
* In other words, are commands are not being executed under some company.
* @return true When we are a deity, i.e. company mode is not active.
* @post !ScriptCompanyMode::IsValid().
*/
static bool IsDeity();
};
#endif /* SCRIPT_COMPANYMODE_HPP */