public void Dump() { if (log == null) { return; } log.AppendLine("Part count = ", allParts.Count); // Output a nice tree view of the rocket if (allParts.Count > 0) { PartSim root = allParts[0]; while (root.parent != null) { root = root.parent; } if (root.hasVessel) { log.Append("vesselName = '", vesselName, "' vesselType = ", SimManager.GetVesselTypeString(vesselType)); } root.DumpPartToLog(log, "", allParts); } log.Flush(); }
public void DumpPartToBuffer(StringBuilder buffer, String prefix, List <PartSim> allParts = null) { buffer.Append(prefix); buffer.Append(this.name); buffer.AppendFormat(":[id = {0:d}, decouple = {1:d}, invstage = {2:d}", this.partId, this.decoupledInStage, this.inverseStage); buffer.AppendFormat(", vesselName = '{0}'", this.vesselName); buffer.AppendFormat(", vesselType = {0}", SimManager.GetVesselTypeString(this.vesselType)); buffer.AppendFormat(", initialVesselName = '{0}'", this.initialVesselName); buffer.AppendFormat(", fuelCF = {0}", this.fuelCrossFeed); buffer.AppendFormat(", noCFNKey = '{0}'", this.noCrossFeedNodeKey); buffer.AppendFormat(", isSep = {0}", this.isSepratron); for (int i = 0; i < this.resources.Types.Count; i++) { int type = this.resources.Types[i]; buffer.AppendFormat(", {0} = {1:g6}", ResourceContainer.GetResourceName(type), this.resources[type]); } if (this.attachNodes.Count > 0) { buffer.Append(", attached = <"); this.attachNodes[0].DumpToBuffer(buffer); for (int i = 1; i < this.attachNodes.Count; i++) { buffer.Append(", "); this.attachNodes[i].DumpToBuffer(buffer); } buffer.Append(">"); } // Add more info here buffer.Append("]\n"); if (allParts != null) { String newPrefix = prefix + " "; for (int i = 0; i < allParts.Count; i++) { PartSim partSim = allParts[i]; if (partSim.parent == this) { partSim.DumpPartToBuffer(buffer, newPrefix, allParts); } } } }
public void Dump() { StringBuilder buffer = new StringBuilder(1024); buffer.AppendFormat("Part count = {0:d}\n", this.allParts.Count); // Output a nice tree view of the rocket if (this.allParts.Count > 0) { PartSim root = this.allParts[0]; while (root.parent != null) { root = root.parent; } if (root.hasVessel) { buffer.AppendFormat("vesselName = '{0}' vesselType = {1}\n", this.vesselName, SimManager.GetVesselTypeString(this.vesselType)); } root.DumpPartToBuffer(buffer, "", this.allParts); } MonoBehaviour.print(buffer); }