Remove support for old-style campaigns.

These won't work any more since they won't be able to define factories
or supply routes. They were made obsolete ages ago, so just remove them.
This commit is contained in:
Dan Albert 2021-04-19 01:54:16 -07:00
parent a3ff58c42d
commit bb3e83548c

View File

@ -494,14 +494,7 @@ class ConflictTheater:
logging.warning("Replacing existing frontline data") logging.warning("Replacing existing frontline data")
self._frontline_data = data self._frontline_data = data
def add_controlpoint( def add_controlpoint(self, point: ControlPoint):
self, point: ControlPoint, connected_to: Optional[List[ControlPoint]] = None
):
if connected_to is None:
connected_to = []
for connected_point in connected_to:
point.connect(to=connected_point)
self.controlpoints.append(point) self.controlpoints.append(point)
def find_ground_objects_by_obj_name(self, obj_name): def find_ground_objects_by_obj_name(self, obj_name):
@ -707,26 +700,11 @@ class ConflictTheater:
t = theater() t = theater()
miz = data.get("miz", None) miz = data.get("miz", None)
if miz is not None: if miz is None:
MizCampaignLoader(directory / miz, t).populate_theater() raise RuntimeError(
return t "Old format (non-miz) campaigns are no longer supported."
)
cps = {} MizCampaignLoader(directory / miz, t).populate_theater()
for p in data["player_points"]:
cp = t.add_json_cp(theater, p)
cp.captured = True
cps[p["id"]] = cp
t.add_controlpoint(cp)
for p in data["enemy_points"]:
cp = t.add_json_cp(theater, p)
cps[p["id"]] = cp
t.add_controlpoint(cp)
for l in data["links"]:
cps[l[0]].connect(cps[l[1]])
cps[l[1]].connect(cps[l[0]])
return t return t