![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include <tradecalculation.h>
Public Member Functions | |
| trade_generator () | |
| Constructor for trade calculator. More... | |
| void | add_all_cities () |
| Adds all cities to trade generator. More... | |
| void | add_city (struct city *pcity) |
| Adds single city to trade generator. More... | |
| void | add_tile (struct tile *ptile) |
| Adds/removes tile to trade generator. More... | |
| void | calculate () |
| Finds trade routes to establish. More... | |
| void | clear_trade_planing () |
| Clears genrated routes, virtual cities, cities. More... | |
| void | remove_city (struct city *pcity) |
| Removes single city from trade generator. More... | |
| void | remove_virtual_city (struct tile *ptile) |
| Removes virtual city from trade generator. More... | |
Public Attributes | |
| bool | hover_city |
| QList< qtiles > | lines |
| QList< struct city * > | virtual_cities |
| QList< trade_city * > | cities |
Private Member Functions | |
| bool | discard_any (trade_city *tc, int freeroutes) |
| Drops all trade routes for given city. More... | |
| int | find_over_max (struct city *pcity) |
| Finds highest number of trade routes over maximum for all cities, skips given city. More... | |
| trade_city * | find_most_free () |
| Finds city with highest trade routes possible. More... | |
| void | check_if_done (trade_city *tc1, trade_city *tc2) |
| Marks cities with full trade routes to finish searching. More... | |
| void | discard () |
| Drops all possible trade routes. More... | |
| void | discard_trade (trade_city *tc1, trade_city *tc2) |
| Drops trade routes between given cities. More... | |
| void | find_certain_routes () |
| Adds routes for cities which can only have maximum possible trade routes. More... | |
Definition at line 52 of file tradecalculation.h.
| trade_generator::trade_generator | ( | ) |
Constructor for trade calculator.
Definition at line 42 of file tradecalculation.cpp.
| void trade_generator::add_all_cities | ( | ) |
Adds all cities to trade generator.
Definition at line 47 of file tradecalculation.cpp.
Referenced by mr_menu::slot_trade_add_all().
| void trade_generator::add_city | ( | struct city * | pcity | ) |
Adds single city to trade generator.
Definition at line 82 of file tradecalculation.cpp.
Referenced by add_all_cities(), and add_tile().
| void trade_generator::add_tile | ( | struct tile * | ptile | ) |
Adds/removes tile to trade generator.
Definition at line 93 of file tradecalculation.cpp.
Referenced by map_view::shortcut_pressed().
| void trade_generator::calculate | ( | ) |
Finds trade routes to establish.
Definition at line 161 of file tradecalculation.cpp.
Referenced by mr_menu::slot_calculate().
|
private |
Marks cities with full trade routes to finish searching.
Definition at line 347 of file tradecalculation.cpp.
Referenced by discard_trade(), and find_certain_routes().
| void trade_generator::clear_trade_planing | ( | ) |
Clears genrated routes, virtual cities, cities.
Definition at line 65 of file tradecalculation.cpp.
Referenced by add_all_cities(), and mr_menu::slot_clear_trade().
|
private |
Drops all possible trade routes.
Definition at line 260 of file tradecalculation.cpp.
Referenced by calculate().
|
private |
Drops all trade routes for given city.
Definition at line 291 of file tradecalculation.cpp.
Referenced by discard().
|
private |
Drops trade routes between given cities.
Definition at line 277 of file tradecalculation.cpp.
Referenced by discard_any().
|
private |
Adds routes for cities which can only have maximum possible trade routes.
Definition at line 310 of file tradecalculation.cpp.
Referenced by calculate().
|
private |
Finds city with highest trade routes possible.
Definition at line 243 of file tradecalculation.cpp.
Referenced by discard().
|
private |
Finds highest number of trade routes over maximum for all cities, skips given city.
Definition at line 228 of file tradecalculation.cpp.
| void trade_generator::remove_city | ( | struct city * | pcity | ) |
Removes single city from trade generator.
Definition at line 124 of file tradecalculation.cpp.
Referenced by add_tile().
| void trade_generator::remove_virtual_city | ( | struct tile * | ptile | ) |
Removes virtual city from trade generator.
Definition at line 140 of file tradecalculation.cpp.
Referenced by add_tile().
| QList<trade_city *> trade_generator::cities |
Definition at line 59 of file tradecalculation.h.
Referenced by add_city(), add_tile(), calculate(), clear_trade_planing(), discard_any(), find_certain_routes(), find_most_free(), find_over_max(), remove_city(), and remove_virtual_city().
| bool trade_generator::hover_city |
Definition at line 56 of file tradecalculation.h.
Referenced by map_view::shortcut_released(), mr_menu::slot_trade_city(), and trade_generator().
| QList<qtiles> trade_generator::lines |
Definition at line 57 of file tradecalculation.h.
Referenced by calculate(), clear_trade_planing(), find_certain_routes(), popup_action_selection(), and mr_menu::slot_autocaravan().
| QList<struct city *> trade_generator::virtual_cities |
Definition at line 58 of file tradecalculation.h.
Referenced by add_tile(), clear_trade_planing(), and remove_virtual_city().