Exemple #1
0
        public GameForm(EnumDifficulty difficultyFromMenuForm)
        {
            InitializeComponent();
            difficulty = difficultyFromMenuForm;

            InitializeGUI();
        }
Exemple #2
0
        private void StartGame(EnumDifficulty d)
        {
            game = new GameForm(d);

            if (game.ShowDialog() == DialogResult.OK)
            {
                this.Visible = true;
            }
            else
            {
                Application.Exit();
            }
        }
Exemple #3
0
        private static List <QuizItem> GetQuizItems <T>(List <T> quizItems, EnumLanguages language, EnumDifficulty difficulty) where T : QuizItemAB
        {
            List <QuizItem> items = new List <QuizItem>();

            quizItems.ForEach(y =>
            {
                QuizItem item = new QuizItem()
                {
                    Question   = y.Question,
                    Answer     = y.Réponse,
                    Anecdote   = y.Anecdote,
                    Difficulty = difficulty,
                    Language   = language
                };

                List <QuizProposal> proposals = new List <QuizProposal>();

                y.Propositions.ForEach(z => { proposals.Add(new QuizProposal {
                        Proposition = z
                    }); });

                item.Proposals = proposals;

                items.Add(item);
            });

            return(items);
        }