Move remnants of db.py to config.py.

This is now just a few prices and income configurations. Both should
probably be defined in YAML but for now this makes the name "db" usable
again.
This commit is contained in:
Dan Albert
2022-02-18 18:22:02 -08:00
parent 9b20a6d053
commit ab6f44cb6f
8 changed files with 42 additions and 71 deletions

View File

@@ -5,7 +5,7 @@ import random
from dataclasses import dataclass
from typing import Iterator, List, Optional, TYPE_CHECKING, Tuple
from game import db
from game.config import RUNWAY_REPAIR_COST
from game.data.groundunitclass import GroundUnitClass
from game.dcs.groundunittype import GroundUnitType
from game.theater import ControlPoint, MissionTarget
@@ -100,11 +100,11 @@ class ProcurementAi:
def repair_runways(self, budget: float) -> float:
for control_point in self.owned_points:
if budget < db.RUNWAY_REPAIR_COST:
if budget < RUNWAY_REPAIR_COST:
break
if control_point.runway_can_be_repaired:
control_point.begin_runway_repair()
budget -= db.RUNWAY_REPAIR_COST
budget -= RUNWAY_REPAIR_COST
if self.is_player:
self.game.message(
"OPFOR has begun repairing the runway at " f"{control_point}"