Пример #1
0
        //Create a method MontarseEnCaballo(Greek) that receives as a
        //parameter a Greek and the goal in the list of occupants (if there is room).

        public void AddGriegoInHorse(Griego griego)
        {
            if (capacity > ocupation)
            {
                ocupants.Add(griego);
                Console.WriteLine("Greek " + griego + " in the horse now!");
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            //Create a horse with a capacity of 20 warriors.
            CaballoDeTroya horse = new CaballoDeTroya(20);

            //Create 3 Greek warriors (Achilles, Agamenon, and Ajax).
            Griego griego1  = new Griego("Achilles", 30, 6);
            Griego griego2  = new Griego("Agamenon", 32, 6);
            Griego ggriego3 = new Griego("Ajax", 31, 6);

            //and mount them on the horse
            horse.AddGriegoInHorse(griego1);
            Console.ReadLine();
        }
Пример #3
0
        static void Main(string[] args)
        {
            Troyano t1 = new Troyano();

            t1.SetNombre("Paris");
            t1.SetEdad(1);
            t1.SetFuerza(12);
            t1.SetHerido(true);
            t1.SetMuerto(false);

            Troyano t2 = new Troyano("TroyanoX", 18, 10, false, false);


            //Console.WriteLine("***********************Elene de Troya***********************\n");

            //Console.WriteLine("Alístate en el ejército Troyano. ¡Tu polis te necesita!");
            //Console.WriteLine("Nombre: ");
            //string nombre = Console.ReadLine();
            //Console.WriteLine("Edad: ");
            //int edad = Int32.Parse(Console.ReadLine());
            //Console.WriteLine("Fuerza: ");
            //int fuerza = Int32.Parse(Console.ReadLine());
            //

            t1.MostrarDatos();
            Console.WriteLine();
            t2.MostrarDatos();
            Console.WriteLine();


            Griego g1 = new Griego("GriegoX", 20, 4, false, true);

            g1.MostrarDatos();


            Console.ReadLine();
        }