示例#1
0
 public static void Main()
 {
     Lion herman = new Lion();
     Giraffe zelda = new Giraffe();
     Animal[] two = {herman, zelda};
     Feed(two);
     herman.Attack();
 }
示例#2
0
    void Start()
    {
        Lion butcher = new Lion();

        butcher.Power = 5;
        Gazelle nextMeal = new Gazelle();

        butcher.Attack(nextMeal);
    }
示例#3
0
        public MainWindow()
        {
            InitializeComponent();
            Lion l1 = new Lion();
            Lion l2 = new Lion();



            Console.WriteLine(l1.Hp);
            Console.WriteLine(l2.Hp);
            l1.Attack(l2);
            Console.WriteLine(l1.Hp);
            Console.WriteLine(l2.Hp);
            Szirszar.Content = l1.Hp;
        }