Exemple #1
0
 public FuelTypeData(FuelType type)
 {
     fuelType = type;
     name = type.name;
     tankageMassFraction = type.tankageMassFactor;
     tankageVolumeLoss = type.tankageVolumeLoss;
     costPerDryTon = type.costPerDryTon;
 }
Exemple #2
0
 public FuelTypeData(ConfigNode node)
 {
     name = node.GetStringValue("name");
     fuelType = FuelTypes.INSTANCE.getFuelType(name);
     if (fuelType == null) { throw new NullReferenceException("Fuel type was null for fuel name: " + name); }
     tankageVolumeLoss = node.GetFloatValue("tankageVolumeLoss", fuelType.tankageVolumeLoss);
     tankageMassFraction = node.GetFloatValue("tankageMassFraction", fuelType.tankageMassFactor);
     costPerDryTon = node.GetFloatValue("costPerDryTon", fuelType.costPerDryTon);
 }
Exemple #3
0
        private void loadDefs()
        {
            if (loadedDefs) { return; }
            fuelTypes.Clear();
            resourceVolumes.Clear();

            ConfigNode[] configs = GameDatabase.Instance.GetConfigNodes("SSTU_RESOURCEVOLUME");
            foreach (ConfigNode node in configs)
            {
                resourceVolumes.Add(node.GetStringValue("name"), node.GetFloatValue("volume"));
            }

            configs = GameDatabase.Instance.GetConfigNodes("SSTU_FUELTYPE");
            FuelType fuelType;
            foreach (ConfigNode node in configs)
            {
                fuelType = new FuelType(node);
                fuelTypes.Add(fuelType.name, fuelType);
            }

            loadedDefs = true;
        }