瀏覽代碼

buy: honor ignore_materials too

raylu 2 周之前
父節點
當前提交
86cd2a2f5e
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      buy.py

+ 3 - 1
buy.py

@@ -82,8 +82,10 @@ def get_total_buy(days: int) -> typing.Mapping[str, int]:
 			headers={'Authorization': config.fio_api_key})]
 	buy: dict[str, int] = collections.defaultdict(int)
 	for planet in planets:
+		supply_config = config.supply_config(planet.name)
 		for mat, amount in planet.supply_for_days(days).items():
-			buy[mat] += amount
+			if mat not in supply_config.ignore_materials:
+				buy[mat] += amount
 	return buy
 
 def get_planet_exports_and_ship_storage() -> typing.Mapping[str, int]: