コード例 #1
0
        private void NewGame()
        {
            HeroTargets        = new ObservableCollection <CharacterAccount>();
            NonHeroTargets     = new ObservableCollection <CharacterAccount>();
            AllTargets         = new ObservableCollection <CharacterAccount>();
            VillainTargets     = new ObservableCollection <CharacterAccount>();
            EnvironmentTargets = new ObservableCollection <CharacterAccount>();


            AddBaseIndicesToAllTargets();

            GameContainer.SetupGame();
            SelectCharacters sc = new SelectCharacters(this);

            sc.ShowDialog();
            lbHeroTargets.ItemsSource           = HeroTargets;
            lbNonHeroTargets.ItemsSource        = NonHeroTargets;
            cbDamageAllTargetList.ItemsSource   = AllTargets;
            cbDamageTypeList.ItemsSource        = Enum.GetValues(typeof(DamageType));
            cbDamageAllTargetList.SelectedIndex = 0;
            cbHealAllTargetList.ItemsSource     = AllTargets;
            cbHealAllTargetList.SelectedIndex   = 0;
            cbDamageTypeList.SelectedIndex      = 1;
            tbDmgAmount.Text            = "0";
            tbHealAmount.Text           = "0";
            lbGlobalModList.ItemsSource = GameContainer.ActiveGame.GlobalAllModifiers;

            if (HeroTargets.Count > 0)
            {
                lbHeroTargets.SelectedIndex = 0;
                selectedCharacter           = (CharacterAccount)lbHeroTargets.SelectedItem;
                UpdateSelection();
            }
        }