Exemplo n.º 1
0
 private void Init()
 {
     this.name                        = "unknownPart";
     this.module                      = Part.PartModule.Part;
     this.mesh                        = "model.mu";
     this.rescaleFactor               = 1.25;
     this.scale                       = 1;
     this.author                      = "Unknown";
     this.title                       = "Unknown Mystery Component";
     this.manufacturer                = "Found lying by the side of the road";
     this.description                 = "Nothing is really known about this thing. Use it at your own risk.";
     this.TechRequired                = string.Empty;
     this.bulkheadProfiles            = string.Empty;
     this.subcategory                 = "0";
     this.tags                        = "*";
     this.mass                        = 2.0;
     this.dragModelType               = Part.DragModel.CUBE;
     this.maximum_drag                = 0.1;
     this.minimum_drag                = 0.1;
     this.angularDrag                 = 2.0;
     this.crashTolerance              = 9.0;
     this.breakingForce               = 22.0;
     this.breakingTorque              = 22.0;
     this.explosionPotential          = 0.5;
     this.maxTemp                     = 2000;
     this.skinMaxTemp                 = -1;
     this.heatConductivity            = 0.12;
     this.heatConvectiveConstant      = 1.0;
     this.emissiveConstant            = 0.4;
     this.thermalMassModifier         = 1.0;
     this.skinInternalConductionMult  = 1.0;
     this.radiatorHeadroom            = 0.25;
     this.radiatorMax                 = 0.25;
     this.skinMassPerArea             = 1.0;
     this.fuelCrossFeed               = true;
     this.buoyancy                    = 1.0;
     this.buoyancyUseCubeNamed        = string.Empty;
     this.buoyancyUseSine             = true;
     this.bodyLiftMultiplier          = 1.0;
     this.iconCenter                  = Vector3.Zero;
     this.CoLOffset                   = Vector3.Zero;
     this.CoMOffset                   = Vector3.Zero;
     this.CoPOffset                   = Vector3.Zero;
     this.CenterOfBuoyancy            = Vector3.Zero;
     this.CenterOfDisplacement        = Vector3.Zero;
     this.boundsCentroidOffset        = Vector3.Zero;
     this.boundsMultiplier            = 1.0;
     this.stagingIcon                 = string.Empty;
     this.inverseStageCarryover       = true;
     this.ActivatesEvenIfDisconnected = true;
     this.initRotation                = Quaternion.Identity;
     this.maxLength                   = 10.0;
     this.attachRules                 = new AttachRules();
     this._internalConfig             = new ConfigNode();
     this._resources                  = new PartResourceList(this);
 }
Exemplo n.º 2
0
        public static AttachRules Parse(string value)
        {
            string[] array = value.Split(new char[]
            {
                ','
            });
            if (array.Length < 5)
            {
                throw new Exception("Attach rules are 5 to 8 ints, either ones or zeros, separated by commas!");
            }
            AttachRules attachRules = new AttachRules();

            if (array[0] == "1")
            {
                attachRules.stack = true;
            }
            if (array[1] == "1")
            {
                attachRules.srfAttach = true;
            }
            if (array[2] == "1")
            {
                attachRules.allowStack = true;
            }
            if (array[3] == "1")
            {
                attachRules.allowSftAttach = true;
            }
            if (array[4] == "1")
            {
                attachRules.allowCollision = true;
            }
            if (array.Length >= 6)
            {
                if (array[5] == "1")
                {
                    attachRules.allowDock = true;
                }
            }
            if (array.Length >= 7)
            {
                if (array[6] == "1")
                {
                    attachRules.allowRotate = true;
                }
            }
            if (array.Length >= 8)
            {
                if (array[7] == "1")
                {
                    attachRules.allowRoot = true;
                }
            }
            return(attachRules);
        }
Exemplo n.º 3
0
        private void Load(ConfigNode node)
        {
            this._config = node;
            this.name    = node.GetValue("name");
            int count = node.Values.Count;

            ConfigNode.LoadObjectFromConfig(this, node, false);
            string attachRules = node.GetValue("attachRules");

            if (!string.IsNullOrEmpty(attachRules))
            {
                this.attachRules = AttachRules.Parse(attachRules);
            }
            this._internalConfig = node.GetNode("INTERNAL");
            ConfigNode[] resources = node.GetNodes("RESOURCE");
            int          count2    = resources.Length;

            for (int j = 0; j < count2; j++)
            {
                this._resources.Add(resources[j]);
            }
        }