rubidium@9374: /* $Id$ */ rubidium@9374: rubidium@9374: /** @file ai_company.hpp Everything to query a company's financials and statistics */ rubidium@9374: rubidium@9374: #ifndef AI_COMPANY_HPP rubidium@9374: #define AI_COMPANY_HPP rubidium@9374: rubidium@9374: #include "ai_object.hpp" rubidium@9374: truelight@9447: /** truelight@9447: * Class that handles all company related functions. truelight@9447: */ rubidium@9374: class AICompany : public AIObject { rubidium@9374: public: rubidium@9374: /** truelight@9529: * The name of the class, needed by several sub-processes. truelight@9529: */ truelight@9529: static const char *GetClassName() { return "AICompany"; } truelight@9529: truelight@9529: /** truelight@9447: * Set the name of your company. truelight@9447: * @param name the new name of the company. rubidium@9374: * @pre name != NULL truelight@9575: * @return true if the name was changed. rubidium@9374: */ rubidium@9374: bool SetCompanyName(const char *name); rubidium@9374: rubidium@9374: /** truelight@9447: * Get the name of your company. truelight@9447: * @return the name of your company. truelight@9447: * @note the returned company name must be free'd (C++ only). rubidium@9374: */ rubidium@9374: char *GetCompanyName(); rubidium@9374: rubidium@9374: /** truelight@9575: * Set the name of your president. truelight@9575: * @param name the new name of the president. truelight@9575: * @pre name != NULL truelight@9575: * @return true if the name was changed. truelight@9575: */ truelight@9575: bool SetPresidentName(const char *name); truelight@9575: truelight@9575: /** truelight@9575: * Get the name of your president. truelight@9575: * @return the name of your president. truelight@9575: * @note the returned president name must be free'd (C++ only). truelight@9575: */ truelight@9575: char *GetPresidentName(); truelight@9575: truelight@9575: /** truelight@9447: * Gets the current value of your company. truelight@9447: * @return the current value of your company. rubidium@9374: */ rubidium@9374: int32 GetCompanyValue(); rubidium@9374: rubidium@9374: /** truelight@9447: * Gets the bank balance. In other words, the amount of money you can spent. truelight@9447: * @return the bank balance of your company. rubidium@9374: */ rubidium@9374: int32 GetBankBalance(); rubidium@9374: rubidium@9374: /** truelight@9447: * Gets the amount your company have loaned. truelight@9447: * @return the amount loaned money. truelight@9448: * @post the return value is always non-negative. truelight@9447: * @post GetLoanInterval() is always a multiplier of the return value. rubidium@9374: */ rubidium@9374: int32 GetLoanAmount(); rubidium@9374: rubidium@9374: /** truelight@9447: * Gets the maximum amount your company can loan. truelight@9447: * @return the maximum amount your company can loan. truelight@9448: * @post the return value is always non-negative. truelight@9447: * @post GetLoanInterval() is always a multiplier of the return value. rubidium@9374: */ rubidium@9374: int32 GetMaxLoanAmount(); rubidium@9374: rubidium@9374: /** truelight@9447: * Gets the interval/loan step. truelight@9447: * @return the loan step. truelight@9447: * @post return value is always positive. rubidium@9376: */ rubidium@9376: int32 GetLoanInterval(); rubidium@9376: rubidium@9376: /** truelight@9447: * Sets the amount to loan. truelight@9447: * @param loan the amount to loan (multiplier of GetLoanInterval()). truelight@9448: * @pre loan must be non-negative. truelight@9447: * @pre GetLoanInterval must be a multiplier of loan. truelight@9447: * @pre loan must be below GetMaxLoan(). truelight@9448: * @pre loan - GetLoanAmount() + GetBankBalance() must be non-negative. truelight@9447: * @return true if the loan could be set to your requested amount. rubidium@9374: */ rubidium@9374: bool SetLoanAmount(int32 loan); rubidium@9374: }; rubidium@9374: rubidium@9374: #endif /* AI_COMPANY_HPP */