Ejemplo n.º 1
0
 private void CreateButton(Decision chance)
 {
     Button btn = new Button();
     btn.Tapped += this.BTapped;
     btn.Content = chance.Text;
     btn.Tag = chance.GoTo;            
     this.spButtons.Children.Add(btn);
 }
Ejemplo n.º 2
0
        private void ExecuteEpizode(int EpizodeNumber)
        {

            var epizode = GetEpizode(EpizodeNumber);
            if (epizode == null)
            {
                return;
            }

            var image = Convert(epizode.image);

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

                this.AddRemoveStats(epizode);
            }

            this.Game.CurrentEpizode = EpizodeNumber;


            this.imgBox.Source = image;
            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");
        }