Пример #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Model.Pokemon togekiss   = this.FindResource("Togekiss") as Model.Pokemon;
            Model.Pokemon charmander = this.FindResource("Charmander") as Model.Pokemon;

            togekiss.AttackTarget(charmander, togekiss.Power);
            charmander.AttackTarget(togekiss, charmander.Power);
        }
Пример #2
0
 private void mImage2_MouseDown(object sender, MouseButtonEventArgs e)
 {
     if (e.ChangedButton == MouseButton.Left && e.ClickCount == 2)
     {
         mImage2.Source = new BitmapImage(new Uri("/Resources/charizard.png", UriKind.Relative));
         Model.Pokemon charmander = this.FindResource("Charmander") as Model.Pokemon;
         charmander.HP      = 150;
         charmander.Attack  = 150;
         charmander.Defense = 100;
         charmander.Power   = 120;
     }
 }