示例#1
0
        static void Main(string[] args)
        {
            List <Enemy> enemies = new List <Enemy>();
            Personnage   hero    = new Personnage("toto", 45, 4);

            for (int i = 0; i < 10; i++)
            {
                if (i < 3)
                {
                    Enemy e = new Enemy(EnemyType.Barbare, "le mal " + i, 20);
                    hero.methodeCible += e.ActionDuPersonnage;
                    enemies.Add(e);
                }
                if (i > 3)
                {
                    Enemy e = new Enemy(EnemyType.Goblin, "le mal " + i, 20);
                    hero.methodeCible += e.ActionDuPersonnage;
                    enemies.Add(e);
                }
            }
            hero.TirerPartout(EnemyType.Barbare);
            Console.WriteLine("/**********/");
            hero.TirerPartout(EnemyType.Goblin);
        }
示例#2
0
 public PersonnageEventArg(Personnage source, EnemyType enemyType)
 {
     this.source    = source;
     this.enemyType = enemyType;
 }