def load_territory_owners(self, claim_log: ClaimLog) -> None: # territories BG, TS, OX, VB, etc. owned by zone 0 for territory in self._zone_0_territories: claim_log._station_statuses[territory] = Claimant.ZONE_0 # territories PN, EY, PO, YL owned by zone 1 for territory in self._zone_1_territories: claim_log._station_statuses[territory] = Claimant.ZONE_1
def calculate_scores( self, territory_claims: List[Dict[str, Union[str, int, float]]], ) -> Mapping[Claimant, int]: claim_log = ClaimLog(record_arena_actions=False) for claim in territory_claims: territory = StationCode(claim['station_code']) claimant = Claimant(int(claim['zone'])) claim_log._station_statuses[territory] = claimant return claim_log.get_scores()
def setUp(self) -> None: super().setUp() claim_log = ClaimLog(record_arena_actions=False) self.load_territory_owners(claim_log) self.attached_territories = AttachedTerritories(claim_log) self.connected_territories = self.attached_territories.build_attached_capture_trees( )
def load_territory_owners(self, claim_log: ClaimLog) -> None: for territory in self._zone_0_territories: claim_log._station_statuses[territory] = Claimant.ZONE_0 # type: ignore[index] for territory in self._zone_1_territories: claim_log._station_statuses[territory] = Claimant.ZONE_1 # type: ignore[index]
def setUp(self) -> None: super().setUp() claim_log = ClaimLog(record_arena_actions=False) self.attached_territories = AttachedTerritories(claim_log)