20 /** |
20 /** |
21 * Gets the maximum sign index; there are no valid signs with a higher index. |
21 * Gets the maximum sign index; there are no valid signs with a higher index. |
22 * @return the maximum sign index. |
22 * @return the maximum sign index. |
23 * @post return value is always non-negative. |
23 * @post return value is always non-negative. |
24 */ |
24 */ |
25 SignID GetMaxSignID(); |
25 static SignID GetMaxSignID(); |
26 |
26 |
27 /** |
27 /** |
28 * Gets the number of signs. This is different than GetMaxSignID() |
28 * Gets the number of signs. This is different than GetMaxSignID() |
29 * because of the way OpenTTD works internally. |
29 * because of the way OpenTTD works internally. |
30 * @return the number of signs. |
30 * @return the number of signs. |
31 * @post return value is always non-negative. |
31 * @post return value is always non-negative. |
32 */ |
32 */ |
33 int32 GetSignCount(); |
33 static int32 GetSignCount(); |
34 |
34 |
35 /** |
35 /** |
36 * Checks whether the given sign index is valid. |
36 * Checks whether the given sign index is valid. |
37 * @param sign_id the index to check. |
37 * @param sign_id the index to check. |
38 * @return true if and only if the sign is valid. |
38 * @return true if and only if the sign is valid. |
44 * @param sign_id the sign to get the text of. |
44 * @param sign_id the sign to get the text of. |
45 * @pre sign_id has to be valid (use IsValidSign()). |
45 * @pre sign_id has to be valid (use IsValidSign()). |
46 * @return the text on the sign. |
46 * @return the text on the sign. |
47 * @note the returned name must be free'd (C++ only). |
47 * @note the returned name must be free'd (C++ only). |
48 */ |
48 */ |
49 char *GetText(SignID sign_id); |
49 static char *GetText(SignID sign_id); |
50 |
50 |
51 /** |
51 /** |
52 * Gets the location of the sign. |
52 * Gets the location of the sign. |
53 * @param sign_id the sign to get the location of. |
53 * @param sign_id the sign to get the location of. |
54 * @pre sign_id has to be valid (use IsValidSign()). |
54 * @pre sign_id has to be valid (use IsValidSign()). |
55 * @return the location of the sign. |
55 * @return the location of the sign. |
56 * @post return value is always positive and below AIMap::GetMapSize(). |
56 * @post return value is always positive and below AIMap::GetMapSize(). |
57 */ |
57 */ |
58 TileIndex GetLocation(SignID sign_id); |
58 static TileIndex GetLocation(SignID sign_id); |
59 |
59 |
60 /** |
60 /** |
61 * Removes a sign from the map. |
61 * Removes a sign from the map. |
62 * @param sign_id the sign to remove. |
62 * @param sign_id the sign to remove. |
63 * @pre sign_id has to be valid (use IsValidSign()). |
63 * @pre sign_id has to be valid (use IsValidSign()). |
64 * @return true if and only if the sign has been removed. |
64 * @return true if and only if the sign has been removed. |
65 */ |
65 */ |
66 bool RemoveSign(SignID sign_id); |
66 static bool RemoveSign(SignID sign_id); |
67 |
67 |
68 /** |
68 /** |
69 * Builds a sign on the map. |
69 * Builds a sign on the map. |
70 * @param location the place to build the sign. |
70 * @param location the place to build the sign. |
71 * @param text the text to place on the sign. |
71 * @param text the text to place on the sign. |
73 * @pre text is not NULL and non-empty, i.e. length is positive. |
73 * @pre text is not NULL and non-empty, i.e. length is positive. |
74 * @return the SignID of the build sign (use IsValidSign() to check for validity). |
74 * @return the SignID of the build sign (use IsValidSign() to check for validity). |
75 * In test-mode it returns 0 if successful, or any other value to indicate |
75 * In test-mode it returns 0 if successful, or any other value to indicate |
76 * failure. |
76 * failure. |
77 */ |
77 */ |
78 SignID BuildSign(TileIndex location, const char *text); |
78 static SignID BuildSign(TileIndex location, const char *text); |
79 }; |
79 }; |
80 |
80 |
81 #endif /* AI_SIGN_HPP */ |
81 #endif /* AI_SIGN_HPP */ |