Freeciv-3.1
|
#include <stddef.h>
Go to the source code of this file.
Enumerations | |
enum | attr_object_type_start_keys { ATTR_UNIT_START = 0 * 100 * 1000 * 1000 , ATTR_CITY_START = 1 * 100 * 1000 * 1000 , ATTR_PLAYER_START = 2 * 100 * 1000 * 1000 , ATTR_TILE_START = 3 * 100 * 1000 * 1000 } |
enum | attr_unit { ATTR_UNIT_DUMMY = ATTR_UNIT_START } |
enum | attr_city { ATTR_CITY_CMA_PARAMETER = ATTR_CITY_START , ATTR_CITY_CMAFE_PARAMETER } |
enum | attr_player { ATTR_PLAYER_DUMMY = ATTR_PLAYER_START } |
enum | attr_tile { ATTR_TILE_DUMMY = ATTR_TILE_START } |
Functions | |
void | attribute_init (void) |
void | attribute_free (void) |
void | attribute_flush (void) |
void | attribute_restore (void) |
void | attribute_set (int key, int id, int x, int y, size_t data_length, const void *const data) |
size_t | attribute_get (int key, int id, int x, int y, size_t max_data_length, void *data) |
void | attr_unit_set (enum attr_unit what, int unit_id, size_t data_length, const void *const data) |
size_t | attr_unit_get (enum attr_unit what, int unit_id, size_t max_data_length, void *data) |
void | attr_unit_set_int (enum attr_unit what, int unit_id, int data) |
size_t | attr_unit_get_int (enum attr_unit what, int unit_id, int *data) |
void | attr_city_set (enum attr_city what, int city_id, size_t data_length, const void *const data) |
size_t | attr_city_get (enum attr_city what, int city_id, size_t max_data_length, void *data) |
void | attr_city_set_int (enum attr_city what, int city_id, int data) |
size_t | attr_city_get_int (enum attr_city what, int city_id, int *data) |
void | attr_player_set (enum attr_player what, int player_id, size_t data_length, const void *const data) |
size_t | attr_player_get (enum attr_player what, int player_id, size_t max_data_length, void *data) |
void | attr_tile_set (enum attr_tile what, int x, int y, size_t data_length, const void *const data) |
size_t | attr_tile_get (enum attr_tile what, int x, int y, size_t max_data_length, void *data) |
enum attr_city |
Enumerator | |
---|---|
ATTR_CITY_CMA_PARAMETER | |
ATTR_CITY_CMAFE_PARAMETER |
Definition at line 37 of file attribute.h.
Enumerator | |
---|---|
ATTR_UNIT_START | |
ATTR_CITY_START | |
ATTR_PLAYER_START | |
ATTR_TILE_START |
Definition at line 26 of file attribute.h.
enum attr_player |
Enumerator | |
---|---|
ATTR_PLAYER_DUMMY |
Definition at line 42 of file attribute.h.
enum attr_tile |
Enumerator | |
---|---|
ATTR_TILE_DUMMY |
Definition at line 46 of file attribute.h.
enum attr_unit |
Enumerator | |
---|---|
ATTR_UNIT_DUMMY |
Definition at line 33 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 491 of file attribute.c.
Referenced by attr_city_get_int(), and cma_get_parameter().
size_t attr_city_get_int | ( | enum attr_city | what, |
int | city_id, | ||
int * | data | ||
) |
Get city related integer attribute
Definition at line 508 of file attribute.c.
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 482 of file attribute.c.
Referenced by attr_city_set_int(), city_remove(), cma_set_parameter(), and release_city().
void attr_city_set_int | ( | enum attr_city | what, |
int | city_id, | ||
int | data | ||
) |
Set city related integer attribute
Definition at line 500 of file attribute.c.
size_t attr_player_get | ( | enum attr_player | what, |
int | player_id, | ||
size_t | max_data_length, | ||
void * | data | ||
) |
Get player related attribute
Definition at line 525 of file attribute.c.
void attr_player_set | ( | enum attr_player | what, |
int | player_id, | ||
size_t | data_length, | ||
const void *const | data | ||
) |
Set player related attribute
Definition at line 516 of file attribute.c.
size_t attr_tile_get | ( | enum attr_tile | what, |
int | x, | ||
int | y, | ||
size_t | max_data_length, | ||
void * | data | ||
) |
Get tile related attribute
Definition at line 543 of file attribute.c.
void attr_tile_set | ( | enum attr_tile | what, |
int | x, | ||
int | y, | ||
size_t | data_length, | ||
const void *const | data | ||
) |
Set tile related attribute
Definition at line 534 of file attribute.c.
size_t attr_unit_get | ( | enum attr_unit | what, |
int | unit_id, | ||
size_t | max_data_length, | ||
void * | data | ||
) |
Get unit related attribute
Definition at line 457 of file attribute.c.
Referenced by attr_unit_get_int().
size_t attr_unit_get_int | ( | enum attr_unit | what, |
int | unit_id, | ||
int * | data | ||
) |
Get unit related integer attribute
Definition at line 474 of file attribute.c.
void attr_unit_set | ( | enum attr_unit | what, |
int | unit_id, | ||
size_t | data_length, | ||
const void *const | data | ||
) |
Set unit related attribute
Definition at line 448 of file attribute.c.
Referenced by attr_unit_set_int().
void attr_unit_set_int | ( | enum attr_unit | what, |
int | unit_id, | ||
int | data | ||
) |
Set unit related integer attribute
Definition at line 466 of file attribute.c.
void attribute_flush | ( | void | ) |
Send current state to the server. Note that the current implementation will send all attributes to the server.
Definition at line 327 of file attribute.c.
Referenced by client_exit(), disconnect_from_server(), send_save_game(), and send_turn_done().
void attribute_free | ( | void | ) |
Frees the attribute module.
Definition at line 123 of file attribute.c.
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, NULL)
Definition at line 415 of file attribute.c.
Referenced by attr_city_get(), attr_player_get(), attr_tile_get(), and attr_unit_get().
void attribute_init | ( | void | ) |
Initializes the attribute module.
Definition at line 114 of file attribute.c.
Referenced by client_game_init(), and client_game_reset().
void attribute_restore | ( | void | ) |
Recreate the attribute set from the player's attribute_block. Shouldn't be used by normal code.
Definition at line 354 of file attribute.c.
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 383 of file attribute.c.
Referenced by attr_city_set(), attr_player_set(), attr_tile_set(), and attr_unit_set().