protected override void OnLoad(ConfigNode node) { vessel_node = node.GetNode("VESSEL"); resources = new VesselResources(vessel_node); name = node.GetValue("name"); flag = node.GetValue("flag"); id = new Guid(node.GetValue("id")); }
protected override void OnLoad(ConfigNode node) { ConfigNode vessel_node = node.GetNode("VESSEL"); proto_vessel = new ProtoVessel(vessel_node, HighLogic.CurrentGame); id = proto_vessel.vesselID; name = proto_vessel.vesselName; resources = new VesselResources(proto_vessel); }
public StoredVessel(Vessel vsl) { proto_vessel = vsl.BackupVessel(); metric = new Metric(vsl, true); id = proto_vessel.vesselID; name = proto_vessel.vesselName; crew = proto_vessel.GetVesselCrew(); resources = new VesselResources(proto_vessel); }
public StoredVessel(Vessel vsl) { vessel = vsl.BackupVessel(); metric = new Metric(vsl); id = vessel.vesselID; CoM = vsl.findLocalCenterOfMass(); crew = vsl.GetVesselCrew(); resources = new VesselResources <ProtoVessel, ProtoPartSnapshot, ProtoPartResourceSnapshot>(vessel); // fixTripLogger(); //FIXME }
public PackedConstruct(ShipConstruct construct, string flag) { this.flag = flag; this.construct = construct; vessel_node = construct.SaveShip(); vessel_node.name = "VESSEL"; resources = new VesselResources(vessel_node); name = Localizer.Format(construct.shipName); id = Guid.NewGuid(); }
public PackedConstruct(string file, string flag) { this.flag = flag; vessel_node = ConfigNode.Load(file); vessel_node.name = "VESSEL"; resources = new VesselResources(vessel_node); if (LoadConstruct()) { name = construct.shipName; id = Guid.NewGuid(); } }
protected PackedConstruct(PackedConstruct pc) { flag = pc.flag; vessel_node = pc.vessel_node; metric = pc.metric; name = pc.name; resources = new VesselResources(vessel_node); if (pc.construct != null) { LoadConstruct(); } id = Guid.NewGuid(); }
public void ExtractProtoVesselCrew(Vessel dest_vessel, Part start_from_part = null) { if (vessel == null) { return; } if (start_from_part != null) { CrewTransferBatch.moveCrew(vessel, start_from_part, false); } CrewTransferBatch.moveCrew(vessel, dest_vessel, false); proto_vessel = vessel.BackupVessel(); resources = new VesselResources(proto_vessel); }
public override void Load(ConfigNode node) { ConfigNode vessel_node = node.GetNode("VESSEL"); ConfigNode metric_node = node.GetNode("METRIC"); ConfigNode crew_node = node.GetNode("CREW"); vessel = new ProtoVessel(vessel_node, FlightDriver.FlightStateCache); metric = new Metric(metric_node); crew = new List <ProtoCrewMember>(); foreach (ConfigNode cn in crew_node.nodes) { crew.Add(new ProtoCrewMember(cn)); } id = vessel.vesselID; CoM = ConfigNode.ParseVector3(node.GetValue("CoM")); resources = new VesselResources <ProtoVessel, ProtoPartSnapshot, ProtoPartResourceSnapshot>(vessel); }
//all initialization goes here instead of the constructor as documented in Unity API void update_resources() { hangarResources = new VesselResources <Vessel, Part, PartResource>(vessel); }