Пример #1
0
 public Rocket(RocketConfiguration config, List <Surface> surfaces) : this(config)
 {
     this.Surfaces = surfaces;
     foreach (Surface surface in this.Surfaces)
     {
         if (surface.IsExterior)
         {
             ExteriorSurfaces.Add(surface);
         }
     }
     GetDragCoefficients();
 }
Пример #2
0
        public Rocket RocketFromSTL()
        {
            if (!IsValid)
            {
                throw new InvalidOperationException("Cannot make rocket from invalid STL file. Check file validity and try again.");
            }

            // Set configuration
            RocketConfiguration config = new RocketConfiguration()
            {
                CenterOfMass     = new Vector3D <float>(),
                CenterOfPressure = new Vector3D <float>(),
                CenterOfThrust   = new Vector3D <float>(),
            };

            // Set surfaces

            return(new Rocket(config, STL.Surfaces));
        }
Пример #3
0
    public void setRocketConfiguration(RocketConfiguration config)
    {
        currentRocketConfiguration = config;
        stages.Clear();
        for (int stage = 0; stage < config.numStages; stage++)
        {
            stages.Add(new Stage(
                           0, "", "", null, null,
                           config.fuelCapacities[stage], config.burnRates[stage], config.fuelCapacities[stage],
                           config.weights[stage],
                           0, 0));
        }
        if (currentFuelTank != null)
        {
            setFuelTank(currentFuelTank);
        }

        if (currentFuelType != null)
        {
            setFuelType(currentFuelType);
        }
    }
Пример #4
0
    public void Setup(Item item, int itemType, FuelType fuel = null, FuelTank tank = null, RocketConfiguration config = null)
    {
        this.currentItem = item;
        this.itemType    = itemType;


        switch (this.itemType)
        {
        case 0:
            this.currentType = fuel;
            break;

        case 1:
            this.currentTank = tank;
            break;

        case 2:
            this.currentConfig = config;
            break;

        default:
            break;
        }
    }
Пример #5
0
 public Rocket(RocketConfiguration config)
 {
     this.Config           = config;
     this.Surfaces         = new List <Surface>();
     this.ExteriorSurfaces = new List <Surface>();
 }