示例#1
0
 private void BuyPotionButton_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     if (GameViewModel.Instance.GoldCounter >= potion.Price)
     {
         GameViewModel.Instance.GoldCounter -= this.potion.Price;
         GameViewModel.Instance.MainCastle.PotionStock.Add(potion.DuplicatePotion());
     }
     else
     {
         int missingGold = potion.Price - GameViewModel.Instance.GoldCounter;
         System.Windows.MessageBox.Show("Il vous manque " + missingGold + " d'or monseigneur");
     }
 }