Example #1
0
        void OnOK(object sender, EventArgs args)
        {
            GameSession.Types types = GameSession.Types.None;

            if (checkbox_logic.Active)
            {
                types |= GameSession.Types.LogicPuzzles;
            }

            if (checkbox_calculation.Active)
            {
                types |= GameSession.Types.Calculation;
            }

            if (checkbox_verbal.Active)
            {
                types |= GameSession.Types.VerbalAnalogies;
            }


            TreeIter iter;

            layout_combo.GetActiveIter(out iter);
            int sides = (int)layout_combo.Model.GetValue(iter, COLUMN_VALUE);

            GeneratePdf(types,
                        (int)games_spinbutton.Value,
                        sides,
                        Difficulty,
                        colorblindcheckbutton.Active,
                        file.Filename);
        }
Example #2
0
 public GameManager()
 {
     game_type       = GameSession.Types.None;
     difficulty      = GameDifficulty.Medium;
     available_games = new List <GameLocator> ();
     play_list       = new List <int> ();
     cnt_logic       = cnt_memory = cnt_calculation = cnt_verbal = 0;
     RandomOrder     = true;
 }
Example #3
0
        List<int> play_list; // Play list for the Selected difficulty, game types

        #endregion Fields

        #region Constructors

        public GameManager()
        {
            game_type = GameSession.Types.None;
            difficulty = GameDifficulty.Medium;
            available_games = new List <GameLocator> ();
            play_list = new List <int> ();
            cnt_logic = cnt_memory = cnt_calculation = cnt_verbal = 0;
            RandomOrder = true;
        }
 public GameSessionPlayList(GameManager manager)
 {
     this.manager = manager;
     play_list    = new List <int> ();
     game_type    = GameSession.Types.AllGames;
     difficulty   = GameDifficulty.Medium;
     RandomOrder  = true;
     dirty        = true;
 }
Example #5
0
        List<int> play_list; // Play list for the Selected difficulty, game types

        #endregion Fields

        #region Constructors

        public GameSessionPlayList(GameManager manager)
        {
            this.manager = manager;
            play_list = new List <int> ();
            game_type = GameSession.Types.AllGames;
            difficulty = GameDifficulty.Medium;
            RandomOrder = true;
            dirty = true;
        }
Example #6
0
        void OnNewGame(GameSession.Types type)
        {
            // If the translation is lower than MIN_TRANSLATION explain that running the English version is an option
            if (ShouldShowTranslationWarning())
            {
                ShowTranslationWarning();
            }

            session.Type = type;
            session.New();
            GetNextGame();
            GameSensitiveUI();
            UpdateSolution(Translations.GetString("Once you have an answer type it in the \"Answer:\" entry box and press the \"OK\" button."),
                           GameDrawingArea.SolutionType.Tip);
            UpdateStatusBar();
        }
Example #7
0
        void GeneratePdf(GameSession.Types types, int num_games, int gamespage, GameDifficulty difficulty, bool colorblind, string filename)
        {
            Game []     games;
            GameSession session;
            string      msg;
            MessageType msg_type;

            games                       = new Game [num_games];
            session                     = new GameSession(Translations);
            session.GameManager         = manager;
            session.PlayList.ColorBlind = colorblind;
            session.PlayList.Difficulty = difficulty;
            session.PlayList.GameType   = types;

            for (int n = 0; n < num_games; n++)
            {
                games [n] = session.PlayList.GetPuzzle();
                games [n].Translations = Translations;
            }

            if (pdfExporter.GeneratePdf(games, gamespage, filename) == true)
            {
                msg      = Catalog.GetString("The PDF file has been exported correctly.");
                msg_type = MessageType.Info;
            }
            else
            {
                msg      = Catalog.GetString("There was a problem generating the PDF file. The file has not been created.");
                msg_type = MessageType.Error;
            }

            // Notify operation result
            MessageDialog md = new MessageDialog(this, DialogFlags.Modal, msg_type, ButtonsType.Ok, msg);

            md.Run();
            md.Destroy();
        }