![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
Include dependency graph for worklist.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| struct | worklist |
Macros | |
| #define | MAX_LEN_WORKLIST 64 |
| #define | MAX_NUM_WORKLISTS 16 |
| #define | worklist_iterate(_list, _p) |
| #define | worklist_iterate_end |
Functions | |
| void | worklist_init (struct worklist *pwl) |
| Initialize a worklist to be empty. More... | |
| int | worklist_length (const struct worklist *pwl) |
| Returns the number of entries in the worklist. More... | |
| bool | worklist_is_empty (const struct worklist *pwl) |
| Returns whether worklist has no elements. More... | |
| bool | worklist_peek (const struct worklist *pwl, struct universal *prod) |
| Fill in the id and is_unit values for the head of the worklist if the worklist is non-empty. More... | |
| bool | worklist_peek_ith (const struct worklist *pwl, struct universal *prod, int idx) |
| Fill in the id and is_unit values for the ith element in the worklist. More... | |
| void | worklist_advance (struct worklist *pwl) |
| Remove first element from worklist. More... | |
| void | worklist_copy (struct worklist *dst, const struct worklist *src) |
| Copy contents from worklist src to worklist dst. More... | |
| void | worklist_remove (struct worklist *pwl, int idx) |
| Remove element from position idx. More... | |
| bool | worklist_append (struct worklist *pwl, const struct universal *prod) |
| Adds the id to the next available slot in the worklist. More... | |
| bool | worklist_insert (struct worklist *pwl, const struct universal *prod, int idx) |
| Inserts the production at the location idx in the worklist, thus moving all subsequent entries down. More... | |
| bool | are_worklists_equal (const struct worklist *wlist1, const struct worklist *wlist2) |
| Return TRUE iff the two worklists are equal. More... | |
| #define MAX_LEN_WORKLIST 64 |
Definition at line 19 of file worklist.h.
| #define MAX_NUM_WORKLISTS 16 |
Definition at line 20 of file worklist.h.
| #define worklist_iterate | ( | _list, | |
| _p | |||
| ) |
Definition at line 47 of file worklist.h.
| #define worklist_iterate_end |
Definition at line 55 of file worklist.h.
Return TRUE iff the two worklists are equal.
Definition at line 183 of file worklist.cpp.
| void worklist_advance | ( | struct worklist * | pwl | ) |
Remove first element from worklist.
Definition at line 98 of file worklist.cpp.
Referenced by city_set_queue().
Adds the id to the next available slot in the worklist.
'id' is the ID of the unit/building to be produced; is_unit specifies whether it's a unit or a building. Returns TRUE if successful.
Definition at line 138 of file worklist.cpp.
Referenced by base_city_queue_insert(), dio_get_worklist_raw(), and global_worklists_build().
Copy contents from worklist src to worklist dst.
Definition at line 103 of file worklist.cpp.
Referenced by city_get_queue(), city_set_queue(), global_worklist_set(), global_worklists_build(), global_worklists_unbuild(), handle_city_info(), handle_city_worklist(), and package_city().
| void worklist_init | ( | struct worklist * | pwl | ) |
Initialize a worklist to be empty.
For elements, only really need to set [0], but initialize the rest to avoid junk values in savefile.
Definition at line 32 of file worklist.cpp.
Referenced by city_dialog::clear_worklist(), city_widget::clear_worlist(), create_city_virtual(), dio_get_worklist_raw(), global_worklist_alloc(), global_worklists_build(), handle_city_info(), and worklist_load().
Inserts the production at the location idx in the worklist, thus moving all subsequent entries down.
'id' specifies the unit/building to be produced; is_unit tells whether it's a unit or building. Returns TRUE if successful.
Definition at line 158 of file worklist.cpp.
Referenced by base_city_queue_insert(), city_get_queue(), production_widget::prod_selected(), city_dialog::worklist_down(), and city_dialog::worklist_up().
| bool worklist_is_empty | ( | const struct worklist * | pwl | ) |
Returns whether worklist has no elements.
Definition at line 60 of file worklist.cpp.
Referenced by city_set_queue(), cr_entry_building(), and worklist_change_build_target().
| int worklist_length | ( | const struct worklist * | pwl | ) |
Returns the number of entries in the worklist.
The returned value can also be used as the next available worklist index (assuming that len < MAX_LEN_WORKLIST).
Definition at line 51 of file worklist.cpp.
Referenced by base_city_queue_insert(), city_build_unit(), city_production_build_units(), city_queue_insert_worklist(), city_dialog::dbl_click_p(), dio_put_worklist_raw(), city_widget::display_list_menu(), global_worklist_save(), global_worklists_build(), global_worklists_save(), global_worklists_unbuild(), production_widget::prod_selected(), city_dialog::update_improvements(), worklist_append(), and worklist_change_build_target().
Fill in the id and is_unit values for the head of the worklist if the worklist is non-empty.
Return 1 iff id and is_unit are valid.
Definition at line 70 of file worklist.cpp.
Referenced by city_set_queue().
Fill in the id and is_unit values for the ith element in the worklist.
If the worklist has fewer than idx elements, return FALSE.
Definition at line 80 of file worklist.cpp.
Referenced by city_production_build_units(), worklist_change_build_target(), city_dialog::worklist_down(), worklist_peek(), and city_dialog::worklist_up().
| void worklist_remove | ( | struct worklist * | pwl, |
| int | idx | ||
| ) |
Remove element from position idx.
Definition at line 113 of file worklist.cpp.
Referenced by city_build_unit(), city_get_queue(), city_dialog::dbl_click_p(), production_widget::prod_selected(), worklist_advance(), worklist_change_build_target(), city_dialog::worklist_down(), and city_dialog::worklist_up().