Collect taxes * @bug Function seems to be doing different things depending on * Micropolis::totalPop value. With an non-empty city it does fund * calculations. For an empty city, it immediately sets effects of * funding, which seems inconsistent at least, and may be wrong * @bug If Micropolis::taxFlag is set, no variable is touched which seems * non-robust at least */
| 836 | * non-robust at least |
| 837 | */ |
| 838 | void Micropolis::collectTax() |
| 839 | { |
| 840 | short z; |
| 841 | |
| 842 | /** |
| 843 | * @todo Break out so the user interface can configure this. |
| 844 | */ |
| 845 | static const float RLevels[3] = { 0.7, 0.9, 1.2 }; |
| 846 | static const float FLevels[3] = { 1.4, 1.2, 0.8 }; |
| 847 | |
| 848 | assert(LEVEL_COUNT == LENGTH_OF(RLevels)); |
| 849 | assert(LEVEL_COUNT == LENGTH_OF(FLevels)); |
| 850 | |
| 851 | cashFlow = 0; |
| 852 | |
| 853 | /** |
| 854 | * @todo Apparently taxFlag is never set to true in MicropolisEngine |
| 855 | * or the TCL code, so this always runs. |
| 856 | * @todo Check old Mac code to see if it's ever set, and why. |
| 857 | */ |
| 858 | |
| 859 | if (!taxFlag) { // If the Tax Port is clear |
| 860 | |
| 861 | /// @todo Do something with z? Check old Mac code to see if it's used. |
| 862 | z = cityTaxAverage / 48; // post release |
| 863 | |
| 864 | cityTaxAverage = 0; |
| 865 | |
| 866 | policeFund = (long)policeStationPop * 100; |
| 867 | fireFund = (long)fireStationPop * 100; |
| 868 | roadFund = (long)((roadTotal + (railTotal * 2)) * RLevels[gameLevel]); |
| 869 | taxFund = (long)((((Quad)totalPop * landValueAverage) / 120) * cityTax * FLevels[gameLevel]); |
| 870 | |
| 871 | if (totalPop > 0) { |
| 872 | /* There are people to tax. */ |
| 873 | cashFlow = (short)(taxFund - (policeFund + fireFund + roadFund)); |
| 874 | doBudget(); |
| 875 | } else { |
| 876 | /* Nobody lives here. */ |
| 877 | roadEffect = MAX_ROAD_EFFECT; |
| 878 | policeEffect = MAX_POLICE_STATION_EFFECT; |
| 879 | fireEffect = MAX_FIRE_STATION_EFFECT; |
| 880 | } |
| 881 | } |
| 882 | } |
| 883 | |
| 884 | |
| 885 | /** |
nothing calls this directly
no outgoing calls
no test coverage detected