calculate_loot.py 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. """Test file for construction costs"""
  2. from rival_regions_calc import ConstructionCosts, Building
  3. ZUID_BUILDINGS = {
  4. 'hospital': 1208,
  5. 'military base': 815,
  6. 'school': 775,
  7. 'missile system': 1250,
  8. 'sea port': 978,
  9. 'power plant': 1400,
  10. 'spaceport': 3,
  11. 'airport': 1100,
  12. 'house fund': 4050,
  13. }
  14. OOST_BUILDINGS = {
  15. 'hospital': 1226,
  16. 'military base': 813,
  17. 'school': 775,
  18. 'missile system': 4550,
  19. 'sea port': 2475,
  20. 'power plant': 1461,
  21. 'spaceport': 201,
  22. 'airport': 3750,
  23. 'house fund': 3795,
  24. }
  25. WEST_BUILDINGS = {
  26. # 'hospital': 2426,
  27. # 'military base': 1640,
  28. # 'school': 1325,
  29. # 'missile system': 1500,
  30. # 'sea port': 1250,
  31. # 'power plant': 2500,
  32. # 'spaceport': 601,
  33. # 'airport': 1250,
  34. # 'house fund': 7765,
  35. # 'hospital': 1213,
  36. # 'military base': 820,
  37. # 'school': 663,
  38. # 'missile system': 720,
  39. # 'sea port': 625,
  40. # 'power plant': 1250,
  41. # 'spaceport': 301,
  42. # 'airport': 625,
  43. # 'house fund': 3883,
  44. # 'hospital': 2572,
  45. # 'military base': 1701,
  46. # 'school': 1616,
  47. # 'missile system': 1500,
  48. # 'sea port': 2000,
  49. # 'power plant': 2500,
  50. # 'spaceport': 1115,
  51. # 'airport': 2000,
  52. # 'house fund': 8371,
  53. 'military academy': 48,
  54. 'hospital': 2465,
  55. 'military base': 617,
  56. 'school': 1580,
  57. 'missile system': 550,
  58. 'power plant': 1450,
  59. 'spaceport': 50,
  60. 'airport': 500,
  61. 'house fund': 8242,
  62. }
  63. def main():
  64. """Main method"""
  65. # print('oost')
  66. # calculate(OOST_BUILDINGS)
  67. # print('zuid')
  68. # calculate(ZUID_BUILDINGS)
  69. print('west')
  70. calculate(WEST_BUILDINGS)
  71. def calculate(buildings):
  72. """calculate and print resources"""
  73. print('cash,gold,oil,ore,uranium,diamond')
  74. for building_name, amount in buildings.items():
  75. amount = int(amount/4)
  76. building = Building(building_name)
  77. construction_costs = ConstructionCosts(building, amount)
  78. construction_costs.calculate(amount)
  79. print('{},{},{},{},{},{}'.format(
  80. construction_costs.cash,
  81. construction_costs.gold,
  82. construction_costs.oil,
  83. construction_costs.ore,
  84. construction_costs.uranium,
  85. construction_costs.diamond,
  86. ))
  87. def bucks(integer):
  88. """Format number"""
  89. return '{:,}'.format(integer).replace(',', '.')
  90. if __name__ == "__main__":
  91. main()