示例#1
0
        static void Main(string[] args)
        {
            //Cree Villagois
            var vil1 = new VillagoisC8("Bob", 4, 100, 55, 9);
            var vil2 = new VillagoisC8("Bobette", 2, 100, 99, 67);

            //Cree Hero : Villagois
            var hero1 = new HeroC8("Joe", 12, 100, 55, 12);

            //Affiche Villagois : Hero
            Console.WriteLine(hero1.ToString());
            Console.WriteLine(hero1.Inventaire());

            //Affiche Villagois
            Console.WriteLine(vil1.ToString());
            Console.WriteLine(vil2.ToString());

            //Cree Armes & Armure
            var arme1   = new ArmeC8("Crayon Destructeur", 1);
            var armure1 = new ArmureC8("Manteau de Pluie", 1);

            //Equip Test
            hero1.Equiper(arme1);
            hero1.Equiper(armure1);
            //Affiche Test
            Console.WriteLine(hero1.Inventaire());


            Console.WriteLine();


            //Test Armes Armure Affichage ToString
            Console.WriteLine(hero1.Arme.ToString());
            Console.WriteLine(hero1.Armure.ToString());

            //afficher les obj cree
            Console.WriteLine(GetAffichageNbObjets());
            Console.WriteLine(GetAffichageNbVillagois());
        }
示例#2
0
 //Thats what it is !
 public void Equiper(ArmeC8 arme)
 {
     _arme = arme;
 }
示例#3
0
 // constructor using base att protected
 public HeroC8(string nom, int force, int endurance, int dexterite, int intelligence) : base(nom, force, endurance, dexterite, intelligence)
 {
     Arme   = new ArmeC8("Mains Nues", 0);
     Armure = new ArmureC8("Vetements", 0);
 }