![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
Include dependency graph for distribute.cpp:Go to the source code of this file.
Functions | |
| void | distribute (int number, int groups, int *ratios, int *result) |
| Distribute "number" elements into "groups" groups with ratios given by the elements in "ratios". More... | |
| void distribute | ( | int | number, |
| int | groups, | ||
| int * | ratios, | ||
| int * | result | ||
| ) |
Distribute "number" elements into "groups" groups with ratios given by the elements in "ratios".
The resulting division is put into the "result" array.
For instance this code is used to distribute trade among science, tax, and luxury. In this case "number" is the amount of trade, "groups" is 3, and ratios[3] = {sci_rate, tax_rate, lux_rate}.
The algorithm used to determine the distribution is Hamilton's Method.
Definition at line 29 of file distribute.cpp.
Referenced by add_tax_income(), and dai_manage_taxes().