public VesselKit( PartModule host, ShipConstruct ship, bool assembled = true, bool simulate = false ) : this() { Host = host; Name = Localizer.Format(ship.shipName); ship.Parts.ForEach(p => p.UpdateMass()); if (!simulate) { strip_resources(ship, assembled); Blueprint = ship.SaveShip(); } var create_resources = count_kit_resources(ship, assembled); ShipMetric = new Metric((IShipconstruct)ship, true, true); DockingNodes = FindDockingNodes(ship, ShipMetric); var final_assembly_work = 0f; ship.Parts.ForEach(p => { var kit = new PartKit(p, assembled); final_assembly_work += p.mass * GLB.FinalizationWorkPerMass * 3600; Jobs.Add(kit); }); create_resources.ForEach(r => { var assembled_resource = r.Value.type == KitResourceInfo.ResourceType.CONSTRUCTED; Jobs.Add(new PartKit(r.Value.name, r.Value.mass, r.Value.cost, assembled_resource ? 0 : 1, 0, assembled_resource)); }); Jobs.Add(new PartKit("Final Assembly", 0, 0, 0, final_assembly_work, true)); if (assembled) { SetStageComplete(DIYKit.ASSEMBLY, true); } HasLaunchClamps = ship.HasLaunchClamp(); CurrentIndex = 0; }
public VesselKit(PartModule host, ShipConstruct ship, bool assembled = true, bool simulate = false) : this() { Host = host; Name = Localizer.Format(ship.shipName); if (!simulate) { strip_resources(ship, assembled); Blueprint = ship.SaveShip(); } count_kit_resources(ship); ShipMetric = new Metric(ship, true, true); DockingNodes = FindDockingNodes(ship, ShipMetric); Jobs.AddRange(ship.Parts.ConvertAll(p => new PartKit(p, assembled))); SetStageComplete(DIYKit.ASSEMBLY, assembled); HasLaunchClamps = ship.HasLaunchClamp(); CurrentIndex = 0; }
public VesselKit(PartModule host, ShipConstruct ship, bool assembled = true, bool simulate = false) : this() { Host = host; Name = Localizer.Format(ship.shipName); if (!simulate) { strip_resources(ship, assembled); Blueprint = ship.SaveShip(); } var create_resources = count_kit_resources(ship, assembled); ShipMetric = new Metric(ship, true, true); DockingNodes = FindDockingNodes(ship, ShipMetric); Jobs.AddRange(ship.Parts.ConvertAll(p => new PartKit(p, assembled))); create_resources.ForEach(r => Jobs.Add(new PartKit(r.Value.name, r.Value.mass, r.Value.cost, r.Value.type == KitResourceInfo.ResourceType.CONSTRUCTED))); SetStageComplete(DIYKit.ASSEMBLY, assembled); HasLaunchClamps = ship.HasLaunchClamp(); CurrentIndex = 0; }