Added function to get cp number of fuel depots

This commit is contained in:
Khopa 2021-06-08 13:18:27 +02:00
parent f4c54bb9e6
commit 51fa0a0891

View File

@ -780,6 +780,22 @@ class ControlPoint(MissionTarget, ABC):
"""Return the number of ammo depots, including dead ones"""
return len([obj for obj in self.connected_objectives if obj.category == "ammo"])
@property
def active_fuel_depots_count(self) -> int:
"""Return the number of available fuel depots"""
return len(
[
obj
for obj in self.connected_objectives
if obj.category == "fuel" and not obj.is_dead
]
)
@property
def total_fuel_depots_count(self) -> int:
"""Return the number of fuel depots, including dead ones"""
return len([obj for obj in self.connected_objectives if obj.category == "fuel"])
@property
def strike_targets(self) -> List[Union[MissionTarget, Unit]]:
return []