コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: emospy/MyFirstTest
        private void ExecuteEpizode(int EpizodeNumber)
        {
            var epizode = GetEpizode(EpizodeNumber);
            if (epizode == null)
            {
                return;
            }

            if (this.isLoadedGame == false)
            {
                this.AddRemoveItems(epizode);

                this.AddRemoveStats(epizode);
            }

            this.Game.CurrentEpizode = EpizodeNumber;

            this.PrepareText(epizode);

            if (CheckIfDead())
            {
                var choice = new Decision();
                choice.Text = "Продължи";
                choice.GoTo = 1001;
                this.CreateButton(choice);
            }
            else
            {
                this.PrepareChoices(epizode);
            }

            this.isLoadedGame = false;

            this.RefreshStats();

            this.SaveGame("Autosave.xml");
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: emospy/MyFirstTest
 private void CreateButton(Decision chance)
 {
     Button btn = new Button();
     btn.Click += this.Click;
     btn.Content = chance.Text;
     btn.Tag = chance.GoTo;
     this.spButtons.Children.Add(btn);
 }