Collection of question objects
コード例 #1
0
        /// <summary>
        /// Init the main window
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();

            try
            {
                masterPRNG = new Random(Convert.ToInt32(System.DateTime.Now));
            }
            catch
            {
                masterPRNG = new Random();
            }

            qCollection = new QuestionCollection(masterPRNG);
            richTextBox1.AppendText("Loading questions..." + Environment.NewLine);
            if (qCollection.LoadQuestions(System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "\\NCCQuestions", richTextBox1) == false)
            {
                MessageBox.Show("Having to exit due to not being able to find the questions directory!", "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return;
            }
            richTextBox1.AppendText("Loaded questions." + Environment.NewLine);

            button1.IsEnabled = false;
            button2.IsEnabled = false;
            button3.IsEnabled = false;
            button4.IsEnabled = false;
            button5.IsEnabled = true;
            button6.IsEnabled = false;
            button7.IsEnabled = false;
        }
コード例 #2
0
        /// <summary>
        /// Init the main window
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();

            try
            {

               masterPRNG = new Random(Convert.ToInt32(System.DateTime.Now));
            }
            catch
            {
                masterPRNG = new Random();
            }

            qCollection = new QuestionCollection(masterPRNG);
            richTextBox1.AppendText("Loading questions..." + Environment.NewLine);
            if(qCollection.LoadQuestions(System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "\\NCCQuestions", richTextBox1) == false){
                MessageBox.Show("Having to exit due to not being able to find the questions directory!", "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return;
            }
            richTextBox1.AppendText("Loaded questions." + Environment.NewLine);

            button1.IsEnabled = false;
            button2.IsEnabled = false;
            button3.IsEnabled = false;
            button4.IsEnabled = false;
            button5.IsEnabled = true;
            button6.IsEnabled = false;
            button7.IsEnabled = false;
        }
コード例 #3
0
ファイル: Game.cs プロジェクト: nccgroup/44Con2013Game
 /// <summary>
 /// Parent object of the game
 /// </summary>
 public Game(QuestionCollection qCollectionIn, MainWindow myMain, Random myPRNG)
 {
     this.PlayerName = "";
     this.PlayerEMail = "";
     this.PlayerStarted = false;
     this.FoneAFriend = false;
     this.AskTheAudiance = false;
     this.FiftyFifty = false;
     this.MoreTime = false;
     this.Level = 0;
     this.Seconds = 0;
     this.qCollection = qCollectionIn;
     this.MyMain = myMain;
     this.timer.Tick += new EventHandler(timer_Tick);
     this.timer.Interval = new TimeSpan(0, 0, 1);
     this.rngPRNG = myPRNG;
 }
コード例 #4
0
ファイル: Game.cs プロジェクト: nccgroup/44Con2013Game
 /// <summary>
 /// Parent object of the game
 /// </summary>
 public Game(QuestionCollection qCollectionIn, MainWindow myMain, Random myPRNG)
 {
     this.PlayerName     = "";
     this.PlayerEMail    = "";
     this.PlayerStarted  = false;
     this.FoneAFriend    = false;
     this.AskTheAudiance = false;
     this.FiftyFifty     = false;
     this.MoreTime       = false;
     this.Level          = 0;
     this.Seconds        = 0;
     this.qCollection    = qCollectionIn;
     this.MyMain         = myMain;
     this.timer.Tick    += new EventHandler(timer_Tick);
     this.timer.Interval = new TimeSpan(0, 0, 1);
     this.rngPRNG        = myPRNG;
 }