Public Types | |
enum | GoalID { GOAL_INVALID } |
The goal IDs. More... | |
enum | GoalType { GT_NONE, GT_TILE, GT_INDUSTRY, GT_TOWN, GT_COMPANY } |
Goal types that can be given to a goal. More... | |
enum | QuestionType { QT_QUESTION, QT_INFORMATION, QT_WARNING, QT_ERROR } |
Types of queries we could do to the user. More... | |
enum | QuestionButton { BUTTON_CANCEL, BUTTON_OK, BUTTON_NO, BUTTON_YES, BUTTON_DECLINE, BUTTON_ACCEPT, BUTTON_IGNORE, BUTTON_RETRY, BUTTON_PREVIOUS, BUTTON_NEXT, BUTTON_STOP, BUTTON_START, BUTTON_GO, BUTTON_CONTINUE, BUTTON_RESTART, BUTTON_POSTPONE, BUTTON_SURRENDER, BUTTON_CLOSE } |
Static Public Member Functions | |
static bool | IsValidGoal (GoalID goal_id) |
Check whether this is a valid goalID. | |
static GoalID | New (GSCompany::CompanyID company, Text *goal, GoalType type, uint32 destination) |
Create a new goal. | |
static bool | Remove (GoalID goal_id) |
Remove a goal from the list. | |
static bool | Question (uint16 uniqueid, GSCompany::CompanyID company, Text *question, QuestionType type, int buttons) |
Ask a question. | |
static bool | CloseQuestion (uint16 uniqueid) |
Close the question on all clients. |
Goals are saved and loaded. Upon bankruptcy or company takeover, all company specific goals are removed for that company. You can also remove individual goals using Remove.
enum GSGoal::GoalID |
enum GSGoal::GoalType |
enum GSGoal::QuestionType |
Types of queries we could do to the user.
Basically the title of the question window.
static bool GSGoal::IsValidGoal | ( | GoalID | goal_id | ) | [static] |
Check whether this is a valid goalID.
goal_id | The GoalID to check. |
static GoalID GSGoal::New | ( | GSCompany::CompanyID | company, | |
Text * | goal, | |||
GoalType | type, | |||
uint32 | destination | |||
) | [static] |
Create a new goal.
company | The company to create the goal for, or GSCompany::COMPANY_INVALID for all. | |
goal | The goal to add to the GUI (can be either a raw string, or a GSText object). | |
type | The type of the goal. | |
destination | The destination of the type type. |
goal != NULL && len(goal) != 0.
company == COMPANY_INVALID || ResolveCompanyID(company) != COMPANY_INVALID.
static bool GSGoal::Remove | ( | GoalID | goal_id | ) | [static] |
Remove a goal from the list.
goal_id | The goal to remove. |
IsValidGoal(goal_id).
static bool GSGoal::Question | ( | uint16 | uniqueid, | |
GSCompany::CompanyID | company, | |||
Text * | question, | |||
QuestionType | type, | |||
int | buttons | |||
) | [static] |
Ask a question.
uniqueid | Your unique id to distinguish results of multiple questions in the returning event. | |
company | The company to ask the question, or GSCompany::COMPANY_INVALID for all. | |
question | The question to ask (can be either a raw string, or a GSText object). | |
type | The type of question that is being asked. | |
buttons | Any combinations (at least 1, up to 3) of buttons defined in QuestionButton. Like BUTTON_YES + BUTTON_NO. |
question != NULL && len(question) != 0.
company == COMPANY_INVALID || ResolveCompanyID(company) != COMPANY_INVALID.
CountBits(buttons) >= 1 && CountBits(buttons) <= 3.
There is no guarantee you ever get a reply on your question.
static bool GSGoal::CloseQuestion | ( | uint16 | uniqueid | ) | [static] |
Close the question on all clients.
uniqueid | The uniqueid of the question you want to close. |