Exemplo n.º 1
0
        public String[] GetCategoriesNames()
        {
            StorageService ss = new StorageService();
            QuestionsSet   qs = ss.DeserializeFromXMLFile <QuestionsSet>(@"..\..\pytania.xml");

            return(qs.Questions.Keys.ToArray());
        }
Exemplo n.º 2
0
 //QUESTION
 public GameState RandomQuestion(GameState gamestate, String CategoryName, QuestionsSet qs)
 {
     gamestate.Question = qs.Questions[CategoryName].Where(q => q.Used == false)
                          .TakeRandom(Random);
     gamestate.QuestionCount += 1;
     return(gamestate);
 }
Exemplo n.º 3
0
        public GameState OneOnOneCategories(GameState gamestate, QuestionsSet questionset)
        {
            gamestate.OneOnOneCategories = new Dictionary <string, bool>();
            var rand = new Random();

            do
            {
                var category = QuestionsSet.Current.Questions.Keys.ToArray().TakeRandom(rand);
                if (gamestate.OneOnOneCategories.ContainsKey(category) == false)
                {
                    gamestate.OneOnOneCategories.Add(category, true);
                }
            } while (gamestate.OneOnOneCategories.Keys.Count < 9);

            return(gamestate);
        }