/// <summary> /// Creates a new Preset from the given ProceduralChute /// </summary> /// <param name="pChute">ProceduralChute to create the object from</param> public Preset(ProceduralChute pChute) { this._name = pChute.presetName; this._description = pChute.presetDescription; this._textureLibrary = pChute.textureLibrary; if (pChute.sizes.Count > 0) { this._sizeID = pChute.sizes[pChute.size].sizeID; } this._cutSpeed = pChute.cutSpeed; this._timer = pChute.timer; this._mustGoDown = pChute.mustGoDown; this._deployOnGround = pChute.deployOnGround; this._spares = pChute.spares; if (textureLibrary != "none") { if (pChute.textures.cases.Count > 0) { this._caseName = pChute.parachuteCase.name; } } this._bodyName = pChute.body.bodyName; this._main = new ChuteParameters(pChute, false); if (pChute.secondaryChute) { this._secondary = new ChuteParameters(pChute, true); } }
/// <summary> /// Creates a new Preset from the given ConfigNode /// </summary> /// <param name="node">ConfigNode to create the object from</param> public Preset(ConfigNode node) { node.TryGetValue("name", ref _name); node.TryGetValue("description", ref _description); node.TryGetValue("textureLibrary", ref _textureLibrary); node.TryGetValue("sizeID", ref _sizeID); node.TryGetValue("cutSpeed", ref _cutSpeed); node.TryGetValue("timer", ref _timer); node.TryGetValue("mustGoDown", ref _mustGoDown); node.TryGetValue("deployOnGround", ref _deployOnGround); node.TryGetValue("spares", ref _spares); node.TryGetValue("caseName", ref _caseName); node.TryGetValue("bodyName", ref _bodyName); if (node.HasNode("MAIN")) { _main = new ChuteParameters(node.GetNode("MAIN")); } if (node.HasNode("SECONDARY")) { _secondary = new ChuteParameters(node.GetNode("SECONDARY")); } }
/// <summary> /// Creates a new Preset from the given ProceduralChute /// </summary> /// <param name="pChute">ProceduralChute to create the object from</param> public Preset(ProceduralChute pChute) { this._name = pChute.presetName; this._description = pChute.presetDescription; this._textureLibrary = pChute.textureLibrary; if (pChute.sizes.Count > 0) { this._sizeID = pChute.sizes[pChute.size].sizeID; } this._cutSpeed = pChute.cutSpeed; this._timer = pChute.timer; this._mustGoDown = pChute.mustGoDown; this._deployOnGround = pChute.deployOnGround; this._spares = pChute.spares; if (textureLibrary != "none") { if (pChute.textures.cases.Count > 0) { this._caseName = pChute.parachuteCase.name; } } this._bodyName = pChute.body.bodyName; this._main = new ChuteParameters(pChute, false); if (pChute.secondaryChute) { this._secondary = new ChuteParameters(pChute, true); } }
/// <summary> /// Creates a new Preset from the given ConfigNode /// </summary> /// <param name="node">ConfigNode to create the object from</param> public Preset(ConfigNode node) { node.TryGetValue("name", ref _name); node.TryGetValue("description", ref _description); node.TryGetValue("textureLibrary", ref _textureLibrary); node.TryGetValue("sizeID", ref _sizeID); node.TryGetValue("cutSpeed", ref _cutSpeed); node.TryGetValue("timer", ref _timer); node.TryGetValue("mustGoDown", ref _mustGoDown); node.TryGetValue("deployOnGround", ref _deployOnGround); node.TryGetValue("spares", ref _spares); node.TryGetValue("caseName", ref _caseName); node.TryGetValue("bodyName", ref _bodyName); if (node.HasNode("MAIN")) { _main = new ChuteParameters(node.GetNode("MAIN")); } if (node.HasNode("SECONDARY")) { _secondary = new ChuteParameters(node.GetNode("SECONDARY")); } }