StretchyTanks.StretchyTanks.changeResources C# (CSharp) Method

changeResources() public method

public changeResources ( ) : void
return void
        public void changeResources()
        {
            if (part.Modules.Contains("ModuleFuelTanks"))
                return;

            if (stretchSRB)
                tankType = TANK_SOLID; // NK

            // find volume
            float volume = initialDryMass * 9.203885f * (float)calcVolumeFactor();

            // add resources
            switch (tankType)
            {
                case TANK_MIXED:
                    changeResource("LiquidFuel", 78.22784f * volume);
                    changeResource("Oxidizer", 95.6118f * volume);
                    break;
                case TANK_LIQUID_FUEL:
                    changeResource("LiquidFuel", 49.9789f * volume);
                    break;
                case TANK_MONOPROP:
                    changeResource("MonoPropellant", 203.718f * volume);
                    break;
                case TANK_OXIDIZER:
                    changeResource("Oxidizer", 81.4873f * volume);
                    break;
                case TANK_SOLID:
                    // NK add Solid Fuel
                    // Yields 850 for 1.5t dry mass, like BACC (because dry mass = 1.5 LF/Ox dry mass)
                    // But the RT-10 has way better dry:wet ratio, so pick something inbetween: 1.2794x BACC
                    changeResource("SolidFuel", 192f * volume, false);
                    if (stretchSRB)
                        changeThrust();
                    break;
                case TANK_STRUCTURAL:
                    break;
                default:
                    print("*ST*: Unknown tank type " + tankType);
                    break;
            }

            // remove additional resources
            cleanResources();
        }