diff options
author | yexo <yexo@openttd.org> | 2009-08-01 00:28:21 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2009-08-01 00:28:21 +0000 |
commit | fc03fef4aee9b069bf4f1e8c2109d127246a973a (patch) | |
tree | a9b87cbe46c314a6b6d76193a9144b56d12694f8 /src/ai/api/ai_company.hpp | |
parent | ae71df349ebeeb1732525f34b88ab8d2782f57a4 (diff) | |
download | openttd-fc03fef4aee9b069bf4f1e8c2109d127246a973a.tar.xz |
(svn r17016) -Add [NoAI]: AICompany::Get/Set PresidentGender
Diffstat (limited to 'src/ai/api/ai_company.hpp')
-rw-r--r-- | src/ai/api/ai_company.hpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/ai/api/ai_company.hpp b/src/ai/api/ai_company.hpp index b75fa5fff..feccd6f49 100644 --- a/src/ai/api/ai_company.hpp +++ b/src/ai/api/ai_company.hpp @@ -26,6 +26,13 @@ public: COMPANY_SELF = 254, //!< Constant that gets resolved to the correct company index for your company. }; + /** Possible genders for company presidents. */ + enum Gender { + GENDER_MALE, //!< A male person. + GENDER_FEMALE, //!< A female person. + GENDER_INVALID = -1, //!< An invalid gender. + }; + /** * Resolved the given company index to the correct index for the company. If * the company index was COMPANY_SELF it will be resolved to the index of @@ -79,6 +86,22 @@ public: static char *GetPresidentName(CompanyID company); /** + * Set the gender of the president of your company. + * @param gender The new gender for your president. + * @pre GetPresidentGender(AICompany.COMPANY_SELF) != gender. + * @return True if the gender was changed. + * @note When succesfull a random face will be created. + */ + static bool SetPresidentGender(Gender gender); + + /** + * Get the gender of the president of the given company. + * @param company The company to get the presidents gender off. + * @return The gender of the president. + */ + static Gender GetPresidentGender(CompanyID company); + + /** * Sets the amount to loan. * @param loan The amount to loan (multiplier of GetLoanInterval()). * @pre 'loan' must be non-negative. |