Beispiel #1
0
 private void startBtn_Click(object sender, RoutedEventArgs e)
 {
     foreach (ItemVievModel el in ((ControlViewModel)DataContext).Items)
     {
         ListsForGame.playersList.Add(el.Text);
     }
     if (countPlayers != 0)
     {
         PlayWindow playWindow = new PlayWindow(rndChecked.IsChecked.Value);
         playWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen;
         playWindow.Show();
         Close();
     }
     else if (countPlayers == 0)
     {
         MessageBox.Show("Добавьте хотя бы одного игрока!");
     }
 }
        public MainPlayWindow(TypeQuest type, string player, PlayWindow gameMaster)
        {
            eventMaster = gameMaster;
            typeQuest   = type;

            InitializeComponent();

            playerNicknameText.Text = player;
            if (type == TypeQuest.ActionQuest)
            {
                string quest = ListsForGame.actionList[rnd.Next(0, countActionList)];
                selectedActionQuest.Add(quest);
                questTextblock.Text = quest;
            }
            else if (type == TypeQuest.TrueQuest)
            {
                string quest = ListsForGame.trueList[rnd.Next(0, countTrueList)];
                selectedTrueQuest.Add(quest);
                questTextblock.Text = quest;
            }
        }