def load_from_dict(self, d): super(MovingGroup, self).load_from_dict(d) self.frequency = d.get("frequency") self.task = d.get("task") # ships don't have a task self.spawn_probability = d.get("probability", 1.0) for t in sorted(d.get("tasks", [])): task_dict = d["tasks"][t] self.tasks.append(task._create_from_dict(task_dict)) self.task_selected = d.get("taskSelected", False) self.late_activation = d.get("lateActivation", False)
def load_from_dict(self, d: Dict[str, Any], terrain: Terrain) -> None: super().load_from_dict(d, terrain) self.frequency = d.get("frequency") self.task = d.get("task") # ships don't have a task self.spawn_probability = d.get("probability", 1.0) for t in sorted(d.get("tasks", [])): task_dict = d["tasks"][t] self.tasks.append(task._create_from_dict(task_dict)) self.task_selected = d.get("taskSelected", False) self.late_activation = d.get("lateActivation", False)
def load_from_dict(self, d, translation): super(MovingPoint, self).load_from_dict(d, translation) self.alt_type = d.get("alt_type", None) self.ETA_locked = d["ETA_locked"] self.ETA = d["ETA"] self.speed_locked = d["speed_locked"] task_keys = sorted(d["task"]["params"]["tasks"].keys()) for t in task_keys: self.tasks.append( task._create_from_dict(d["task"]["params"]["tasks"][t])) self.airdrome_id = d.get("airdromeId", None) self.helipad_id = d.get("helipadId", None) self.link_unit = d.get("linkUnit", None) if d.get("properties"): self.properties = PointProperties() self.properties.load_from_dict(d.get("properties")) else: self.properties = None