コード例 #1
0
ファイル: Preset.cs プロジェクト: diomedea/RealChute
 /// <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.editorGUI.presetName;
     this._description    = pChute.editorGUI.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;
     this._landingAlt     = pChute.landingAlt;
     if (textureLibrary != "none")
     {
         if (pChute.textures.cases.Count > 0)
         {
             this._caseName = pChute.parachuteCase.name;
         }
     }
     this._bodyName = pChute.body.bodyName;
     _parameters    = new List <ChuteParameters>(pChute.chutes.Select(c => new ChuteParameters(pChute, c)));
 }
コード例 #2
0
            /// <summary>
            /// Creates a ChuteParameters from the given ProceduralChute
            /// </summary>
            public ChuteParameters(ProceduralChute pChute, ChuteTemplate chute)
            {
                TemplateGUI templateGui = chute.templateGUI;

                this.material            = MaterialsLibrary.MaterialsLibrary.Instance.GetMaterial(templateGui.materialsId).Name;
                this.preDeployedDiameter = templateGui.preDepDiam;
                this.deployedDiameter    = templateGui.depDiam;
                this.minIsPressure       = templateGui.isPressure;
                this.minDeployment       = this.MinIsPressure ? chute.parachute.minDeployment.ToString() : templateGui.predepClause;
                this.minPressure         = this.MinIsPressure ? templateGui.predepClause : chute.parachute.minPressure.ToString();
                this.deploymentAlt       = templateGui.deploymentAlt;
                this.cutAlt             = templateGui.cutAlt;
                this.preDeploymentSpeed = templateGui.preDepSpeed;
                this.deploymentSpeed    = templateGui.depSpeed;
                if (pChute.textureLibrary != "none")
                {
                    if (pChute.textures.Canopies.Count > 0)
                    {
                        this.chuteTexture = pChute.textures.GetCanopy(templateGui.chuteId).Name;
                    }
                    if (pChute.textures.Models.Count > 0)
                    {
                        this.modelName = pChute.textures.GetModel(templateGui.modelId).Name;
                    }
                }
                this.type         = templateGui.TypeId;
                this.calcSelect   = templateGui.calcSelect;
                this.getMass      = templateGui.getMass;
                this.useDry       = templateGui.useDry;
                this.mass         = templateGui.mass;
                this.landingSpeed = templateGui.landingSpeed;
                this.deceleration = templateGui.deceleration;
                this.refDepAlt    = templateGui.refDepAlt;
                this.chuteCount   = templateGui.chuteCount;
            }
コード例 #3
0
ファイル: Preset.cs プロジェクト: diomedea/RealChute
 /// <summary>
 /// Creates a ChuteParameters from the given ProceduralChute
 /// </summary>
 /// <param name="pChute"></param>
 /// <param name="secondary"></param>
 public ChuteParameters(ProceduralChute pChute, ChuteTemplate chute)
 {
     this._material            = MaterialsLibrary.instance.GetMaterial(chute.materialsID).name;
     this._preDeployedDiameter = chute.preDepDiam;
     this._deployedDiameter    = chute.depDiam;
     this._minIsPressure       = chute.isPressure;
     this._minDeployment       = this.minIsPressure ? chute.parachute.minDeployment.ToString() : chute.predepClause;
     this._minPressure         = this.minIsPressure ? chute.predepClause : chute.parachute.minPressure.ToString();
     this._deploymentAlt       = chute.deploymentAlt;
     this._cutAlt             = chute.cutAlt;
     this._preDeploymentSpeed = chute.preDepSpeed;
     this._deploymentSpeed    = chute.depSpeed;
     if (pChute.textureLibrary != "none")
     {
         if (pChute.textures.canopies.Count > 0)
         {
             this._chuteTexture = pChute.textures.GetCanopy(chute.chuteID).name;
         }
         if (pChute.textures.models.Count > 0)
         {
             this._modelName = pChute.textures.GetModel(chute.modelID).name;
         }
     }
     this._type         = RCUtils.types[chute.typeID];
     this._calcSelect   = chute.calcSelect;
     this._getMass      = chute.getMass;
     this._useDry       = chute.useDry;
     this._mass         = chute.mass;
     this._landingSpeed = chute.landingSpeed;
     this._deceleration = chute.deceleration;
     this._refDepAlt    = chute.refDepAlt;
     this._chuteCount   = chute.chuteCount;
 }
コード例 #4
0
ファイル: Preset.cs プロジェクト: linuxgurugamer/RealChute
 /// <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.editorGUI.presetName;
     this.description    = pChute.editorGUI.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;
     this.landingAlt     = pChute.landingAlt;
     this.delayBeforecut = pChute.delayBeforeCut;
     if (this.TextureLibrary != "none")
     {
         if (pChute.textures.Cases.Count > 0)
         {
             this.caseName = pChute.parachuteCase.Name;
         }
     }
     this.Parameters = new List <ChuteParameters>(pChute.chutes.Select(c => new ChuteParameters(pChute, c)));
 }
コード例 #5
0
 /// <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);
     }
 }
コード例 #6
0
            /// <summary>
            /// Creates a ChuteParameters from the given ProceduralChute
            /// </summary>
            /// <param name="pChute"></param>
            /// <param name="secondary"></param>
            public ChuteParameters(ProceduralChute pChute, bool secondary)
            {
                ChuteTemplate temp = secondary ? pChute.secondary : pChute.main;

                this._material            = MaterialsLibrary.instance.GetMaterial(temp.materialsID).name;
                this._preDeployedDiameter = temp.preDepDiam;
                this._deployedDiameter    = temp.depDiam;
                this._minIsPressure       = temp.isPressure;
                this._minDeployment       = this.minIsPressure ? temp.chute.minDeployment.ToString() : temp.predepClause;
                this._minPressure         = this.minIsPressure ? temp.predepClause : temp.chute.minPressure.ToString();
                this._deploymentAlt       = temp.deploymentAlt;
                this._cutAlt             = temp.cutAlt;
                this._preDeploymentSpeed = temp.preDepSpeed;
                this._deploymentSpeed    = temp.depSpeed;
                if (pChute.textureLibrary != "none")
                {
                    if (pChute.textures.canopies.Count > 0)
                    {
                        this._chuteTexture = pChute.textures.GetCanopy(temp.chuteID).name;
                    }
                    if (pChute.textures.models.Count > 0)
                    {
                        this._modelName = pChute.textures.GetModel(temp.modelID).name;
                    }
                }
                this._type         = RCUtils.types[temp.typeID];
                this._calcSelect   = temp.calcSelect;
                this._getMass      = temp.getMass;
                this._useDry       = temp.useDry;
                this._mass         = temp.mass;
                this._landingSpeed = temp.landingSpeed;
                this._deceleration = temp.deceleration;
                this._refDepAlt    = temp.refDepAlt;
                this._chuteCount   = temp.chuteCount;
            }
コード例 #7
0
ファイル: Preset.cs プロジェクト: kevin-ye/RealChute
 /// <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;
     _parameters = new List<ChuteParameters>(pChute.chutes.Select(c => new ChuteParameters(pChute, c)));
 }
コード例 #8
0
ファイル: Preset.cs プロジェクト: vosechu/RealChute
 /// <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); }
 }
コード例 #9
0
ファイル: PresetsLibrary.cs プロジェクト: kevin-ye/RealChute
 /// <summary>
 /// Returns the names of the presets that have a secondary chute or not
 /// </summary>
 /// <param name="pChute">Chute to determine the result from</param>
 public string[] GetRelevantPresets(ProceduralChute pChute)
 {
     return presets.Where(p => p.parameters.Count == pChute.chutes.Count).Select(p => p.name).ToArray();
 }
コード例 #10
0
ファイル: PresetsLibrary.cs プロジェクト: vosechu/RealChute
 /// <summary>
 /// Returns the names of the presets that have a secondary chute or not
 /// </summary>
 /// <param name="pChute">Chute to determine the result from</param>
 public string[] GetRelevantPresets(ProceduralChute pChute)
 {
     return presets.Where(p => p.hasSecondary == pChute.secondaryChute).Select(p => p.name).ToArray();
 }
コード例 #11
0
ファイル: Preset.cs プロジェクト: vosechu/RealChute
 /// <summary>
 /// Creates a ChuteParameters from the given ProceduralChute
 /// </summary>
 /// <param name="pChute"></param>
 /// <param name="secondary"></param>
 public ChuteParameters(ProceduralChute pChute, bool secondary)
 {
     ChuteTemplate temp = secondary ? pChute.secondary : pChute.main;
     this._material = MaterialsLibrary.instance.GetMaterial(temp.materialsID).name;
     this._preDeployedDiameter = temp.preDepDiam;
     this._deployedDiameter = temp.depDiam;
     this._minIsPressure = temp.isPressure;
     this._minDeployment = this.minIsPressure ? temp.chute.minDeployment.ToString() : temp.predepClause;
     this._minPressure = this.minIsPressure ? temp.predepClause : temp.chute.minPressure.ToString();
     this._deploymentAlt = temp.deploymentAlt;
     this._cutAlt = temp.cutAlt;
     this._preDeploymentSpeed = temp.preDepSpeed;
     this._deploymentSpeed = temp.depSpeed;
     if (pChute.textureLibrary != "none")
     {
         if (pChute.textures.canopies.Count > 0) { this._chuteTexture = pChute.textures.GetCanopy(temp.chuteID).name; }
         if (pChute.textures.models.Count > 0) { this._modelName = pChute.textures.GetModel(temp.modelID).name; }
     }
     this._type = RCUtils.types[temp.typeID];
     this._calcSelect = temp.calcSelect;
     this._getMass = temp.getMass;
     this._useDry = temp.useDry;
     this._mass = temp.mass;
     this._landingSpeed = temp.landingSpeed;
     this._deceleration = temp.deceleration;
     this._refDepAlt = temp.refDepAlt;
     this._chuteCount = temp.chuteCount;
 }
コード例 #12
0
ファイル: PresetsLibrary.cs プロジェクト: vosechu/RealChute
 /// <summary>
 /// Returns the names of the presets that have a secondary chute or not
 /// </summary>
 /// <param name="pChute">Chute to determine the result from</param>
 public string[] GetRelevantPresets(ProceduralChute pChute)
 {
     return(presets.Where(p => p.hasSecondary == pChute.secondaryChute).Select(p => p.name).ToArray());
 }
コード例 #13
0
ファイル: Preset.cs プロジェクト: kevin-ye/RealChute
 /// <summary>
 /// Creates a ChuteParameters from the given ProceduralChute
 /// </summary>
 /// <param name="pChute"></param>
 /// <param name="secondary"></param>
 public ChuteParameters(ProceduralChute pChute, ChuteTemplate chute)
 {
     this._material = MaterialsLibrary.instance.GetMaterial(chute.materialsID).name;
     this._preDeployedDiameter = chute.preDepDiam;
     this._deployedDiameter = chute.depDiam;
     this._minIsPressure = chute.isPressure;
     this._minDeployment = this.minIsPressure ? chute.parachute.minDeployment.ToString() : chute.predepClause;
     this._minPressure = this.minIsPressure ? chute.predepClause : chute.parachute.minPressure.ToString();
     this._deploymentAlt = chute.deploymentAlt;
     this._cutAlt = chute.cutAlt;
     this._preDeploymentSpeed = chute.preDepSpeed;
     this._deploymentSpeed = chute.depSpeed;
     if (pChute.textureLibrary != "none")
     {
         if (pChute.textures.canopies.Count > 0) { this._chuteTexture = pChute.textures.GetCanopy(chute.chuteID).name; }
         if (pChute.textures.models.Count > 0) { this._modelName = pChute.textures.GetModel(chute.modelID).name; }
     }
     this._type = RCUtils.types[chute.typeID];
     this._calcSelect = chute.calcSelect;
     this._getMass = chute.getMass;
     this._useDry = chute.useDry;
     this._mass = chute.mass;
     this._landingSpeed = chute.landingSpeed;
     this._deceleration = chute.deceleration;
     this._refDepAlt = chute.refDepAlt;
     this._chuteCount = chute.chuteCount;
 }
コード例 #14
0
ファイル: PresetsLibrary.cs プロジェクト: diomedea/RealChute
 /// <summary>
 /// Returns the names of the presets that have a secondary chute or not
 /// </summary>
 /// <param name="pChute">Chute to determine the result from</param>
 public string[] GetRelevantPresets(ProceduralChute pChute)
 {
     return(presets.Where(p => p.parameters.Count == pChute.chutes.Count).Select(p => p.name).ToArray());
 }