![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include <cstddef>
Include dependency graph for attribute.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Enumerations | |
| enum | attr_object_type_start_keys { ATTR_CITY_START = 1 * 100 * 1000 * 1000 } |
| enum | attr_city { ATTR_CITY_CMA_PARAMETER = ATTR_CITY_START , ATTR_CITY_CMAFE_PARAMETER } |
Functions | |
| void | attribute_init () |
| Initializes the attribute module. More... | |
| void | attribute_free () |
| Frees the attribute module. More... | |
| void | attribute_flush () |
| Send current state to the server. More... | |
| void | attribute_restore () |
| Recreate the attribute set from the player's attribute_block. More... | |
| void | attribute_set (int key, int id, int x, int y, size_t data_length, const void *const data) |
| Low-level function to set an attribute. More... | |
| size_t | attribute_get (int key, int id, int x, int y, size_t max_data_length, void *data) |
| Low-level function to get an attribute. More... | |
| void | attr_city_set (enum attr_city what, int city_id, size_t data_length, const void *const data) |
| Set city related attribute. More... | |
| size_t | attr_city_get (enum attr_city what, int city_id, size_t max_data_length, void *data) |
| Get city related attribute. More... | |
| enum attr_city |
| Enumerator | |
|---|---|
| ATTR_CITY_CMA_PARAMETER | |
| ATTR_CITY_CMAFE_PARAMETER | |
Definition at line 21 of file attribute.h.
| Enumerator | |
|---|---|
| ATTR_CITY_START | |
Definition at line 19 of file attribute.h.
| size_t attr_city_get | ( | enum attr_city | what, |
| int | city_id, | ||
| size_t | max_data_length, | ||
| void * | data | ||
| ) |
Get city related attribute.
Definition at line 410 of file attribute.cpp.
Referenced by cma_yoloswag::get_parameter().
| void attr_city_set | ( | enum attr_city | what, |
| int | city_id, | ||
| size_t | data_length, | ||
| const void *const | data | ||
| ) |
Set city related attribute.
Definition at line 401 of file attribute.cpp.
Referenced by cma_yoloswag::release_city(), governor::run(), and cma_yoloswag::set_parameter().
| void attribute_flush | ( | ) |
Send current state to the server.
Note that the current implementation will send all attributes to the server.
Definition at line 284 of file attribute.cpp.
Referenced by attribute_set(), client_exit(), disconnect_from_server(), and send_turn_done().
| void attribute_free | ( | ) |
Frees the attribute module.
Definition at line 71 of file attribute.cpp.
Referenced by client_game_free(), and client_game_reset().
| size_t attribute_get | ( | int | key, |
| int | id, | ||
| int | x, | ||
| int | y, | ||
| size_t | max_data_length, | ||
| void * | data | ||
| ) |
Low-level function to get an attribute.
If data hasn't enough space to hold the attribute data isn't set to the attribute. Returns the actual size of the attribute. Can be zero if the attribute is unset. To get the size of an attribute use size = attribute_get(key, id, x, y, 0, nullptr)
Definition at line 367 of file attribute.cpp.
Referenced by attr_city_get().
| void attribute_init | ( | ) |
Initializes the attribute module.
Definition at line 66 of file attribute.cpp.
Referenced by client_game_init(), and client_game_reset().
| void attribute_restore | ( | ) |
Recreate the attribute set from the player's attribute_block.
Shouldn't be used by normal code.
Definition at line 305 of file attribute.cpp.
Referenced by handle_player_attribute_chunk().
| void attribute_set | ( | int | key, |
| int | id, | ||
| int | x, | ||
| int | y, | ||
| size_t | data_length, | ||
| const void *const | data | ||
| ) |
Low-level function to set an attribute.
If data_length is zero the attribute is removed.
Definition at line 332 of file attribute.cpp.
Referenced by attr_city_set().