Exemplo n.º 1
0
        protected SpaceCraftBase(string craftDirectory, DVector2 position, DVector2 velocity, double payloadMass,
                                 double propellantMass, string texturePath, ReEntryFlame entryFlame = null)
            : base(position, velocity, -Math.PI * 0.5)
        {
            CraftDirectory = craftDirectory;
            Children       = new List <ISpaceCraft>();

            if (!string.IsNullOrEmpty(texturePath))
            {
                string fullPath = Path.Combine("Textures/Spacecrafts", texturePath);

                if (!File.Exists(fullPath))
                {
                    throw new FileNotFoundException("Could not find texture!", fullPath);
                }

                Texture = new Bitmap(fullPath);
            }

            PayloadMass    = payloadMass;
            PropellantMass = propellantMass;

            EntryFlame = entryFlame;

            MissionName = craftDirectory.Substring(craftDirectory.LastIndexOf('\\') + 1);

            _launchTrails = new Dictionary <string, LaunchTrail>();

            _cachedRelativeVelocity = DVector2.Zero;
        }
Exemplo n.º 2
0
        protected SpaceCraftBase(DVector2 position, DVector2 velocity, double propellantMass, string texturePath, ReEntryFlame entryFlame = null)
            : base(position, velocity, -Math.PI * 0.5)
        {
            Children = new List <ISpaceCraft>();

            Texture        = new Bitmap(texturePath);
            PropellantMass = propellantMass;

            EntryFlame = entryFlame;
        }
Exemplo n.º 3
0
        protected SpaceCraftBase(string craftDirectory, DVector2 position, DVector2 velocity, double propellantMass, string texturePath, ReEntryFlame entryFlame = null)
            : base(position, velocity, -Math.PI * 0.5)
        {
            CraftDirectory = craftDirectory;
            Children       = new List <ISpaceCraft>();

            Texture        = new Bitmap(texturePath);
            PropellantMass = propellantMass;

            EntryFlame = entryFlame;

            MissionName = craftDirectory.Substring(craftDirectory.LastIndexOf('\\') + 1);

            _launchTrail = new LaunchTrail();
        }
Exemplo n.º 4
0
        protected SpaceCraftBase(string craftDirectory, DVector2 position, DVector2 velocity, double payloadMass,
            double propellantMass, string texturePath, ReEntryFlame entryFlame = null)
            : base(position, velocity, -Math.PI * 0.5)
        {
            CraftDirectory = craftDirectory;
            Children = new List<ISpaceCraft>();

            if (!string.IsNullOrEmpty(texturePath))
            {
                Texture = new Bitmap(texturePath);
            }

            PropellantMass = propellantMass;

            EntryFlame = entryFlame;

            MissionName = craftDirectory.Substring(craftDirectory.LastIndexOf('\\') + 1);

            _launchTrail = new LaunchTrail();
        }