Beispiel #1
0
        static void Main(string[] args)
        {
            {
                // create engine
                Engine engine = new Engine {
                    Power = "16000", Thrust = "5000", Size = "5"
                };

                //create a Spaceship
                SpaceShip spaceship = new SpaceShip {
                    Name = "Saturn", Model = "V"
                };
                spaceship.AddEngines(engine);
                spaceship.AddEngines(engine);
                spaceship.AddEngines(engine);
                spaceship.AddEngines(engine);
                spaceship.AddEngines(engine);
                spaceship.AddEngines(engine);
                spaceship.AddEngines(engine);
                spaceship.AddEngines(engine);

                Console.WriteLine(spaceship.ToString());
                Console.WriteLine("Press enter to continue...");
                Console.ReadLine();
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            {
                // create engine
                Engine engine = new Engine { Power = "16000", Thrust = "5000", Size = "5" };

                //create a Spaceship
                SpaceShip spaceship = new SpaceShip { Name = "Saturn", Model = "V" };
                spaceship.AddEngines(engine); 
                spaceship.AddEngines(engine); 
                spaceship.AddEngines(engine); 
                spaceship.AddEngines(engine);
                spaceship.AddEngines(engine);
                spaceship.AddEngines(engine);
                spaceship.AddEngines(engine);
                spaceship.AddEngines(engine);

                Console.WriteLine(spaceship.ToString());
                Console.WriteLine("Press enter to continue...");
                Console.ReadLine();

            }
        }