public void initEquipView(Hero hero)
        {
            this.View.PotionSV.Width        = 450;
            this.View.ShieldSV.Width        = 450;
            this.View.WeaponSV.Width        = 450;
            this.View.ToShieldButton.Click += ToShieldEquipButton_Click;
            this.View.ToWeaponButton.Click += ToWeaponEquipButton_Click;
            this.View.ToPotionButton.Click += ToPotionEquipButton_Click;
            foreach (Shield shield in GameViewModel.Instance.MainCastle.ShieldStock)
            {
                ShieldViewModel newShieldViewModel = new ShieldViewModel(shield, hero);
                newShieldViewModel.InitEquipView();
                this.View.BuyShieldSP.Children.Add(newShieldViewModel.View);
            }

            foreach (Weapon weapon in GameViewModel.Instance.MainCastle.WeaponStock)
            {
                WeaponViewModel newWeaponViewModel = new WeaponViewModel(weapon, hero);
                newWeaponViewModel.InitEquipView();
                this.View.BuyWeaponSP.Children.Add(newWeaponViewModel.View);
            }

            foreach (Potion potion in GameViewModel.Instance.MainCastle.PotionStock)
            {
                PotionViewModel newPotionViewModel = new PotionViewModel(potion, hero);
                newPotionViewModel.InitEquipView();
                this.View.BuyPotionSP.Children.Add(newPotionViewModel.View);
            }
        }
        public void initBlacksmithView()
        {
            this.View.ToShieldButton.Click     += ToShieldEquipButton_Click;
            this.View.ToWeaponButton.Click     += ToWeaponEquipButton_Click;
            this.View.ToPotionButton.Visibility = System.Windows.Visibility.Collapsed;
            foreach (Shield shield in this.Blacksmith.ShieldList)
            {
                ShieldViewModel newShieldViewModel = new ShieldViewModel(shield);
                newShieldViewModel.InitBuyView();
                this.View.BuyShieldSP.Children.Add(newShieldViewModel.View);
            }

            foreach (Weapon weapon in this.Blacksmith.WeaponList)
            {
                WeaponViewModel newWeaponViewModel = new WeaponViewModel(weapon);
                newWeaponViewModel.InitBuyView();
                this.View.BuyWeaponSP.Children.Add(newWeaponViewModel.View);
            }
        }
Beispiel #3
0
 public void  Setup()
 {
     this.vm = new ShieldViewModel();
 }