예제 #1
0
int main(int, char const**)
{
    sf::RenderWindow theWindow(sf::VideoMode(1024, 600), "Submarine");
    sf::RenderTexture theTexture;
    theTexture.create(1024, 600, false);

	sub::TitleScene theScene(false);
	sub::Game theGame(theWindow, theTexture, theScene);
    
	theGame.execute();
	
	return 0;
}
예제 #2
0
int WINAPI wWinMain( HINSTANCE hInst,HINSTANCE,LPWSTR,INT )
{
	WNDCLASSEX wc = { sizeof( WNDCLASSEX ),CS_CLASSDC,MsgProc,0,0,
                      GetModuleHandle( NULL ),NULL,NULL,NULL,NULL,
                      L"Chili DirectX Framework Window",NULL };
    wc.hIconSm = (HICON)LoadImage( hInst,MAKEINTRESOURCE( IDI_APPICON16 ),IMAGE_ICON,16,16,0 );
	wc.hIcon   = (HICON)LoadImage( hInst,MAKEINTRESOURCE( IDI_APPICON32 ),IMAGE_ICON,32,32,0 );
	wc.hCursor = LoadCursor( NULL,IDC_ARROW );
    RegisterClassEx( &wc );
	
	RECT wr;
	wr.left = 650;
	wr.right = 800 + wr.left;
	wr.top = 150;
	wr.bottom = 600 + wr.top;
	AdjustWindowRect( &wr,WS_OVERLAPPEDWINDOW,FALSE );
    HWND hWnd = CreateWindowW( L"Chili DirectX Framework Window",L"Bob's DirectX Framework",
                              WS_OVERLAPPEDWINDOW,wr.left,wr.top,wr.right-wr.left,wr.bottom-wr.top,
                              NULL,NULL,wc.hInstance,NULL );

    ShowWindow( hWnd,SW_SHOWDEFAULT );
    UpdateWindow( hWnd );

	Game theGame( hWnd,kServ,mServ );
	
    MSG msg;
    ZeroMemory( &msg,sizeof( msg ) );
    while( msg.message != WM_QUIT )
    {
        if( PeekMessage( &msg,NULL,0,0,PM_REMOVE ) )
        {
            TranslateMessage( &msg );
            DispatchMessage( &msg );
        }
        else
		{
			theGame.Go();
		}
    }

    UnregisterClass( L"Chili DirectX Framework Window",wc.hInstance );
    return 0;
}
예제 #3
0
int WINAPI wWinMain( HINSTANCE hInst,HINSTANCE,LPWSTR,INT )
{
	WNDCLASSEX wc = { sizeof( WNDCLASSEX ),CS_CLASSDC,MsgProc,0,0,
                      GetModuleHandle( NULL ),NULL,NULL,NULL,NULL,
                      L"ZeroG",NULL };
	wc.hIcon   = LoadIcon(0, IDI_APPLICATION);
	wc.hCursor = LoadCursor( NULL,IDC_ARROW );
    RegisterClassEx( &wc );
	
	RECT wr;
	wr.left = 650;
	wr.right = D3DGraphics::SCREENWIDTH + wr.left;
	wr.top = 150;
	wr.bottom = D3DGraphics::SCREENHEIGHT + wr.top;
	AdjustWindowRect( &wr,WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU,FALSE );
    HWND hWnd = CreateWindowW( L"ZeroG",L"ZeroG",
                              WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU,wr.left,wr.top,wr.right-wr.left,wr.bottom-wr.top,
                              NULL,NULL,wc.hInstance,NULL );

    ShowWindow( hWnd,SW_SHOWDEFAULT );
    UpdateWindow( hWnd );

	Game theGame( hWnd,kServ,mServ );
	
    MSG msg;
    ZeroMemory( &msg,sizeof( msg ) );
    while( msg.message != WM_QUIT )
    {
        if( PeekMessage( &msg,NULL,0,0,PM_REMOVE ) )
        {
            TranslateMessage( &msg );
            DispatchMessage( &msg );
        }
        //else
		{
			theGame.Go();
		}
    }

    UnregisterClass( L"ZeroG",wc.hInstance );
    return 0;
}
예제 #4
0
파일: Windows.cpp 프로젝트: uUJsd7PX/Source
int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE, LPTSTR, INT)
{
    WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0, 0, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, _T("Omega Point Window"), NULL };
    wc.hIconSm = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_APPICON16), IMAGE_ICON, 16, 16, 0);
    wc.hIcon   = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_APPICON32), IMAGE_ICON, 32, 32, 0);
    RegisterClassEx(&wc);
    
    RECT wr;
    wr.left = 100;
    wr.right = 800 + wr.left;
    wr.top = 100;
    wr.bottom = 600 + wr.top;
    AdjustWindowRect(&wr, WS_OVERLAPPEDWINDOW, FALSE);
    HWND hwnd = CreateWindowW(_T("Omega Point Window"), _T("Omega Point"), WS_OVERLAPPEDWINDOW, wr.left, wr.top, wr.right-wr.left, wr.bottom-wr.top, NULL, NULL, wc.hInstance, NULL);

    ShowWindow(hwnd, SW_SHOWDEFAULT);

    CGame theGame(hwnd, keyboardServer, mouseServer);
    
    MSG msg;
    ZeroMemory(&msg, sizeof(msg));
    while(msg.message != WM_QUIT)
    {
        if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
        {
            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
        else
        {
            theGame.Go();
        }
    }

    UnregisterClass(_T("Omega Point Window"), wc.hInstance);
    return 0;
}
예제 #5
0
파일: main.cpp 프로젝트: tal130/C
void main()
{
	//************************************ Create team 1 *********************************
	//Create players for team 1

	Person person1("Eran Zahavi", 21);
	StaffMember staff1(person1, 20000, 3);
	Player player1(staff1, Player::STRICKER, 8);

	Person person2("Yoav Ziv", 26);
	StaffMember staff2(person2, 10000, 1);
	Player player2(staff2, Player::GOALKEEPER, 12);

	//Create coaches for team 1
	Person person3("Slavisa Jokanovic", 58);
	StaffMember staff3(person3, 70000, 30);
	Coach caoch1(staff3, Coach::HEAD);

	Person person4("Domingo Marin", 47);
	StaffMember staff4(person4, 33000, 15);
	Coach caoch2(staff4, Coach::ASSISTANT);

	//Create stadium for team 1
	Stadium stadium1("Blumfild", 40000, "Tel Aviv");

	//Crete team 1
	Team team1(stadium1, 13, "Maccabi");

	//Add the players and the coaches to the team
	team1 += player1;
	team1 += player2;
	team1 += caoch1;
	team1 += caoch2;

	//************************************ Create team 2 *********************************
	//Create players for team 2
	Person person11("Altman Omri", 21);
	StaffMember staff11(person11, 20000, 3);
	Player player11(staff11, Player::STRICKER, 8);

	Person person22("Danin Eyal", 26);
	StaffMember staff22(person22, 10000, 1);
	Player player22(staff22, Player::GOALKEEPER, 12);

	//Create coaches for team 2
	Person person33("Badir Walid", 58);
	StaffMember staff33(person33, 70000, 30);
	Coach caoch11(staff33, Coach::HEAD);

	Person person44("burstein gabriel", 47);
	StaffMember staff44(person44, 33000, 15);
	Coach caoch22(staff44, Coach::ASSISTANT);

	//Create stadium for team 2
	Stadium stadium2("Hapoel Stadium", 30000, "Tel Aviv");

	//Crete team 2
	Team team2(stadium2, 13, "Hapoel Tel Aviv");

	//Add the players and the coaches to the team
	team2 += player11;
	team2 += player22;
	team2 += caoch11;
	team2 += caoch22;

	//*********************************************************************************
	//Create referees for the entire association
	Person refereePerson1("Ben Zion Salman", 37);
	Referee referee1(refereePerson1, Referee::CENTER);

	Person refereePerson2("Naftali Eitan", 46);
	Referee referee2(refereePerson2, Referee::SIDELINE);

	Person refereePerson3("Ozi Itzhaki", 32);
	Referee referee3(refereePerson3, Referee::SIDELINE);

	Person refereePerson4("Ilan Barom", 24);
	Referee referee4(refereePerson4, Referee::ASISSTANT);

	//Create the league
	League league1("Ligat ha al", 2, 1);//two teams one game
	//Add both teams to the league
	league1 += team1;
	league1 += team2;

	//Create a game between the two teams
	Game theGame(stadium1, team1, team2);

	theGame.AddReferee(referee1);
	theGame.AddReferee(referee2);
	theGame.AddReferee(referee3);
	theGame.AddReferee(referee4);

	//Add the game to the league
	league1 += theGame;


	//Create the football association
	Association association1(1, 4);

	//Add the league to the association
	association1.addLeague(league1);

	//Add the referees to the association
	association1.addReferee(referee1);
	association1.addReferee(referee2);
	association1.addReferee(referee3);
	association1.addReferee(referee4);


	//Start the association - start the league - start the game
	association1.start();

	//other unused operators
	team1 -= player2;//Remove player from team
	league1 -= team1;//remove team from league

	//return 0;
}
예제 #6
0
파일: main.cpp 프로젝트: rroa/SpaceCombat
int main(int argc, char** argv)
{    
    spacecombat::Game theGame( "Space Combat", WIDTH, HEIGHT );
    return theGame.OnExecute( );
}
예제 #7
0
int main(int argc, char* argv[]) {
    Game theGame(&argc, argv);
    theGame.run();
    return 0;
}
예제 #8
0
파일: base.cpp 프로젝트: ohargro/capstone
void startScreen()
{
    SDL_WM_SetCaption("9: Pause/Unpause Music, 0: Stop Music, ENTER: Fullscreen", NULL);
    SDL_Color startFontColor = {175, 175, 175};
    SDL_Surface* cyborgMessage = NULL;
    SDL_Surface* startMessage = NULL;
    SDL_Surface* editMessage = NULL;
    cyborgMessage = load_font("eva.ttf", "CYBORG", startFontColor, 79);
    startMessage = load_font("eva.ttf", "BEGIN", startFontColor, 48);
    editMessage = load_font("eva.ttf", "EDIT", startFontColor, 24);

    while(true)
    {
        fps.start();

        while(SDL_PollEvent(&event))
        {
            int x = 0, y = 0;
            if (event.type == SDL_MOUSEMOTION) // mouse moved
            {
                // mouse offsets
                x = event.motion.x;
                y = event.motion.y;

                //If mouse is over startMessage
                if ((x > (screenWidth - 270)) && (x < (screenWidth - 270) + startMessage->w) && (y > (screenHeight - 60)) && (y < (screenHeight - 60) + startMessage->h))
                {
                    //Make startMessage turn white
                    startMessage = load_font("eva.ttf","BEGIN", {255, 255, 255}, 48);
                }
                else
                {
                    //Make startMessage turn grey
                    startMessage = load_font("eva.ttf","BEGIN", {175, 175, 175}, 48);
                }

                // if mouse is over editMessage
                if ((x > (screenWidth - 100)) && (x < (screenWidth - 100) + editMessage->w) && (y > (screenHeight - 92)) && (y < (screenHeight - 92) + editMessage->h))
                {
                    //Make editMessage turn white
                    editMessage = load_font("eva.ttf","EDIT", {255, 255, 255}, 24);
                }
                else
                {
                    //Make editMessage turn grey
                    editMessage = load_font("eva.ttf","EDIT", {175, 175, 175}, 24);
                }
            }
            if (event.type == SDL_MOUSEBUTTONDOWN)
            {
                x = event.motion.x;
                y = event.motion.y;
                //If mouse has clicked on startMessage
                if ((x > (screenWidth - 270)) && (x < (screenWidth - 270) + startMessage->w) && (y > (screenHeight - 60)) && (y < (screenHeight - 60) + startMessage->h))
                {
                    fps.stop();
                    SDL_FreeSurface(cyborgMessage);
                    SDL_FreeSurface(startMessage);
                    SDL_FreeSurface(editMessage);
                    theGame();
                }

                //If mouse has clicked on editMessage
                if ((x > (screenWidth - 100)) && (x < (screenWidth - 100) + editMessage->w) && (y > (screenHeight - 92)) && (y < (screenHeight - 92) + editMessage->h))
                {
                    fps.stop();
                    SDL_FreeSurface(cyborgMessage);
                    SDL_FreeSurface(startMessage);
                    SDL_FreeSurface(editMessage);
                    editLevelScreen();
                }
            }

            myWindow.handle_window();
            handleMusic();

            if(event.type == SDL_QUIT)
            {
                SDL_FreeSurface(cyborgMessage);
                SDL_FreeSurface(startMessage);
                SDL_FreeSurface(editMessage);
                cleanUp();
                exit(0);
            }
        }
        if (myWindow.error())
        {
            cleanUp();
            exit(0);
        }

        apply_surface(0, 0, startBackground, screen);
        apply_surface(screenWidth - cyborgMessage->w - 1 , 5, cyborgMessage, startBackground);
        apply_surface(screenWidth - startMessage->w - 1, screenHeight - startMessage->h - 1, startMessage, startBackground);
        apply_surface(screenWidth - editMessage->w - 1, screenHeight - startMessage->h - editMessage->h - 1, editMessage, startBackground);

        if(SDL_Flip(screen) == -1)
        {
            cleanUp();
            exit(0);
        }

        if(fps.get_ticks() < (1000 / FRAMES_PER_SECOND))
            SDL_Delay(1000 / FRAMES_PER_SECOND - fps.get_ticks());
    }
}
예제 #9
0
파일: main.cpp 프로젝트: frechilla/blockem
/// @brief what can I say? This is the main function!
int main(int argc, char **argv)
{
    // fancy error messages creation with snprintf
    char errorStringBuffer[ERROR_STRING_BUFFER_SIZE];

    // Init type system as soon as possible
    g_type_init ();

    // SINGLETON creation is not thread safe. Ensure they are instantiated
    // before the app creates extra threads
    // BlockemConfig singleton contains general purpose configuration data that
    // will be loaded from the config xml file
    // It MUST be instantiated before i18n in windows because it loads the
    // preferred language
    BlockemConfig::Instance();

    // enable internationalisation support. It MUST be called before
    // ProcessCommandLine
    I18nInit();

    // parse command line options. options will be saved in a bunch of static
    // global variables (scope to this file only) defined at the beginning of
    // this file (they all start with 'g_')
    ProcessCommandLine(argc, argv);

    if (g_version)
    {
        // "version" option takes priority. If it set nothing else will be done
        std::cout << "Blockem, version " << VERSION << " (git commit " << GIT_COMMIT << ")" << std::endl;
        std::cout << "  Compiled " << COMPILETIME << std::endl << std::endl;
        std::cout << "Copyright (C) 2009-2013 Faustino Frechilla" << std::endl;
        std::cout << "Blockem is open source software, see http://blockem.sourceforge.net/"
                  << std::endl << std::endl;
    }
    else if (g_mode == 0)
    {
        //////////////////
        // GUI MODE

        // gtkmm can do strange stuff if its internals are not initialised early
        // enough
        Gtk::Main::init_gtkmm_internals();

        // initialise singletons before extra threads are created.
        // Singleton creation is not thread safe
        // Game1v1Config data. Used to store GUI related configuration for 1vs1 games
        Game1v1Config::Instance();
        Game4PlayersConfig::Instance();
        GameTotalAllocationConfig::Instance();
        GameChallengeConfig::Instance();

        // g_thread_supported returns TRUE if the thread system is initialised,
        // and FALSE if it is not. Initiliase gthreads only if they haven't been
        // initialised already. Since glib 2.24.0 (from its changelog):
        // "the requirements for g_thread_init() have been relaxed slightly, it
        // can be called multiple times, and does not have to be the first call.
        // GObject now links to GThread and threads are enabled automatically
        // when g_type_init() is called"
        // for backwards compatibility call to g_thread_init only if it hasn't
        // been called already
        if(!g_thread_supported())
        {
            // Initialise gthreads even before gtk_init
            g_thread_init(NULL);
        }

        // This call is needed only if extra threads (not the main thread)
        // updates directly the GUI widgets using gdk_threads_enter
        // and gdk_threads_leave
        // It's not really needed since there's only 1 extra thread
        // (apart from the main one) and it doesn't update the GUI
        // straight away. It uses signals for that matter (see comment
        // in MainWindow::WorkerThread_computingFinished)
        //gdk_threads_init();

        // this should be called before starting manipulating GUI stuff
        Gtk::Main kit(argc, argv);

        // create a new gtk builder. add_from_string will load the definitions
        Glib::RefPtr<Gtk::Builder> gtkBuilder = Gtk::Builder::create();
        gtkBuilder->set_translation_domain(GETTEXT_PACKAGE);

        try
        {
            // Load the GUI from the xml code embedded in the executable file
            if (!gtkBuilder->add_from_string(
            // see src/gui_glade.h for more information
                    reinterpret_cast<const char *>(__BIN_GUI_GLADE_START__),
                    reinterpret_cast<gsize>(__BIN_GUI_GLADE_SIZE__)))
            {
                FatalError(
                    argv[0],
                    // i18n TRANSLATORS: Please leave the word Gtkbuilder as it is since it's the name
                    // i18n of the component that failed
                    // i18n Thank you for contributing to this project
                    _("Could not load Gtkbuilder definitions"),
                    GUI_EXCEPTION_ERR);
            }
        }
#ifdef GLIBMM_EXCEPTIONS_ENABLED
        catch(const Glib::MarkupError& ex)
        {
            FatalError(argv[0], ex.what().c_str(), GUI_EXCEPTION_ERR);
        }
        catch(const Gtk::BuilderError& ex)
        {
            FatalError(argv[0], ex.what().c_str(), GUI_EXCEPTION_ERR);
        }
#endif // GLIBMM_EXCEPTIONS_ENABLED
        catch (const GUIException& ex)
        {
            FatalError(argv[0], ex.what(), GUI_EXCEPTION_ERR);
        }

        MainWindow *pMainWindow = NULL;
        try
        {
            // first of all retrieve the Gtk::window object
            gtkBuilder->get_widget_derived(GUI_MAIN_WINDOW_NAME, pMainWindow);
            if (pMainWindow == NULL)
            {
                throw new GUIException(
                            e_GUIException_GTKBuilderErr,
                            __FILE__,
                            __LINE__);
            }

            // if gdk_threads_enter and gdk_threads_leave were to be used
            // the Gtk::Main::run loop should be surrounded by
            // gdk_threads_enter and gdk_threads_leave
            // http://tadeboro.blogspot.com/2009/06/multi-threaded-gtk-applications.html
            kit.run(*pMainWindow);
        }
        catch (const GUIException& ex)
        {
            FatalError(argv[0], ex.what(), GUI_EXCEPTION_ERR);
        }
        catch (const std::exception& ex)
        {
            FatalError(argv[0], ex.what(), GUI_EXCEPTION_ERR);
        }

        if (pMainWindow)
        {
            // valgrind won't be happy if all this memory is not freed
            delete (pMainWindow);
        }

        // GUI MODE
        //////////////////
    }
    else // (g_mode != 0)
    {
        //////////////////
        // CONSOLE mode

        // do whatever we are requested to do per file passed as parameter to the
        // application. App will finish without running any GUI code

        if (g_mode == 1)
        {
            // 1 player total allocation (--mode=1)

            if ( (g_rows == GOPTION_INT_NOT_SET) ||
                 (g_columns == GOPTION_INT_NOT_SET) )
            {
                FatalError(
                    argv[0],
                    _("Number of rows and number of columns must be specified in mode '1'"),
                    TOTAL_ALLOC_BAD_OPTIONS_ERR);
            }

            if ( (g_rows <= 0) || (g_columns <= 0) )
            {
                FatalError(
                    argv[0],
                    _("Number of rows and number of columns must be a greater than 1"),
                    TOTAL_ALLOC_BAD_OPTIONS_ERR);
            }

            if ( (g_startingRow != g_startingColumn) &&
                 ( (g_startingRow == GOPTION_INT_NOT_SET) ||
                   (g_startingColumn == GOPTION_INT_NOT_SET) ) )
            {
                // only one of the 2 options starting row and starting columns was set
                FatalError(
                    argv[0],
                    _("Both starting row and column must be set to configure a starting coordinate"),
                    TOTAL_ALLOC_BAD_OPTIONS_ERR);
            }

            Coordinate startingCoord;
            if ( (g_startingRow != GOPTION_INT_NOT_SET) &&
                 (g_startingColumn != GOPTION_INT_NOT_SET) )
            {
                if ( (g_startingRow >= g_rows) || (g_startingRow < 0) ||
                     (g_startingColumn >= g_columns) || (g_startingColumn < 0) )
                {
                    FatalError(
                        argv[0],
                        _("Application cannot start outside the board boundaries"),
                        TOTAL_ALLOC_BAD_OPTIONS_ERR);
                }

                // overwrite uninitialised starting coordinate with the
                // user-selected one
                startingCoord.m_row = g_startingRow;
                startingCoord.m_col = g_startingColumn;
            }

            GameTotalAllocation theGame(g_rows, g_columns, startingCoord);
            if (theGame.Solve())
            {
                std::cout << std::endl;
                // i18n TRANSLATORS: This string is to be printed when the applications finds
                // i18n a solution to a one-player total-allocation game
                // i18n Thank you for contributing to this project
                std::cout << _("SOLVED!") << std::endl;

                // print solved board on the screen
                theGame.GetBoard().PrintBoard(std::cout);
            }
            else
            {
                std::cout << std::endl;
                if (startingCoord.Initialised())
                {
                    // i18n TRANSLATORS: This string is to be printed when the applications cannot find
                    // i18n a solution to a one-player total-allocation game. The integers printed on the screen
                    // i18n are (respectively) number of rows, number of columns, starting row and starting column
                    // i18n A typical string to be printed:
                    // i18n "Could not allocate all the pieces in this 8x8 board, starting from row 0, column 2"
                    // i18n Thank you for contributing to this project
                    printf(_("Could not allocate all the pieces in this %dx%d board, starting from row %d, columnd %d\n"),
                        g_rows,
                        g_columns,
                        g_startingRow,
                        g_startingColumn);
                }
                else
                {
                    // i18n TRANSLATORS: This string is to be printed when the applications cannot find
                    // i18n a solution to a one-player total-allocation game starting from anywhere in the board
                    // i18n Thank you for contributing to this project
                    printf(_("Could not allocate all the pieces in this %dx%d board starting from anywhere in the board\n"),
                        g_rows,
                        g_columns);
                }
            }
        }
        else if (g_mode == 2)
        {
            // 1vs1 Game (--mode=2)

            if ( (g_blockemfilePath == NULL) || (g_blockemfilePath[0] == NULL) )
            {
                FatalError(
                    argv[0],
                    _("At least one file with a 1vs1Game saved must be specified"),
                    GAME1V1_BAD_OPTIONS_ERR);
            }

            if ( (g_heuristic <  Heuristic::e_heuristicStartCount) ||
                 (g_heuristic >= Heuristic::e_heuristicCount) )
            {
                snprintf(errorStringBuffer,
                         ERROR_STRING_BUFFER_SIZE,
                         // i18n TRANSLATORS: Please, leave that %d as it is. It will be replaced
                         // i18n by the type of heuristic used by the user
                         // i18n Thank you for contributing to this project
                         _("Invalid heuristic type (%d)"),
                         g_heuristic);

                FatalError(
                    argv[0],
                    errorStringBuffer,
                    GAME1V1_BAD_OPTIONS_ERR);
            }

            // this little piece of magic uses the g_heuristic index to pick the expected evaluation
            // function. Have a look at heuristic.h
            Heuristic::EvalFunction_t heuristic = Heuristic::m_heuristicData[g_heuristic].m_evalFunction;
            // i18n TRANSLATORS: This string shows the chosen heuristic's name to the user
            // i18n the 1st %s will be replaced by the heuristic's name, and %d by its index
            // i18n Thank you for contributing to this project
            printf(_("Evaluation function set to %s (%d)\n"),
                   _(Heuristic::m_heuristicData[g_heuristic].m_name),
                   g_heuristic);

            if (g_depth <= 0)
            {
                FatalError(
                    argv[0],
                    _("Depth in 1vs1Game mode must be set to a positive value"),
                    GAME1V1_BAD_OPTIONS_ERR);
            }
            else if ( (g_depth & 0x01) == 0)
            {
                std::cerr << argv[0]
                          << ": "
                          << _("Warning: For better results you might want to set the depth to an odd number")
                          << std::endl;
            }

            // go through all the filenames array. Each file will be loaded into a gam1v1 and the next
            // move will be calculated and printed in the screen
            Game1v1 theGame;
            for (int32_t fileIndex = 0; g_blockemfilePath[fileIndex] != NULL; fileIndex++)
            {
                if (!g_file_test(g_blockemfilePath[fileIndex], G_FILE_TEST_IS_REGULAR))
                {
                    fprintf(stderr,
                            // i18n TRANSLATORS: This string is shown when a file specified by the user
                            // i18n cannot be loaded into the application. The 1st %s will be replaced
                            // i18n by the name of the binary (normally "./blockem"), the 2nd one by
                            // i18n the file that couldn't be accessed. Bear in mind the '\n' character should be there
                            // i18n in the translated version of the string too
                            // i18n Thank you for contributing to this project
                            _("%s: Error: '%s' doesn't exist. Trying next file...\n"),
                            argv[0],
                            g_blockemfilePath[fileIndex]);

                    continue;
                }

                std::ifstream cin;
                cin.open(g_blockemfilePath[fileIndex]);
                if(!cin)
                {
                    fprintf(stderr,
                            // i18n TRANSLATORS: This string is shown when a file specified by the user
                            // i18n could not be opened to be read. The 1st %s will be replaced
                            // i18n by the name of the binary (normally "./blockem"), the 2nd one by
                            // i18n the file that couldn't be opened. Bear in mind the '\n' character should be there
                            // i18n in the translated version of the string too
                            // i18n Thank you for contributing to this project
                            _("%s: Error: '%s' could not be opened. Trying next file...\n"),
                            argv[0],
                            g_blockemfilePath[fileIndex]);

                    continue;
                }

                theGame.Reset();
                if (theGame.LoadGame(cin) == false)
                {
                    fprintf(stderr,
                            // i18n TRANSLATORS: This string is shown when a file specified by the user
                            // i18n does not contain a valid 1vs1 game. The 1st %s will be replaced
                            // i18n by the name of the binary (normally "./blockem"), the 2nd one by
                            // i18n the file that couldn't be opened. Bear in mind the '\n' character should be there
                            // i18n in the translated version of the string too
                            // i18n Thank you for contributing to this project
                            _("%s: Error: '%s' does not contain a valid 1vs1Game. Trying next file...\n"),
                            argv[0],
                            g_blockemfilePath[fileIndex]);

                    cin.close();
                    continue;
                }
                cin.close();

                // i18n TRANSLATORS: '%s' will be replaced here by the path to the file
                // i18n successfully loaded. Bear in mind the '\n' character should be there
                // i18n in the translated version of the string too
                // i18n Thank you for contributing to this project
                printf (_("Game succesfully loaded from '%s'\n"),
                        g_blockemfilePath[fileIndex]);

                // print current game on the screen
                theGame.SaveGame(std::cout);

                //std::cout << std::endl << std::endl;
                //theGame.GetMe().PrintNucleationPoints(std::cout);

                //std::cout << std::endl << std::endl;
                //theGame.GetOpponent().PrintNucleationPoints(std::cout);

                // these 2 variables will save the result calculated by minimax
                Piece resultPiece(e_noPiece);
                Coordinate resultCoord;

                // dummy volatile because no one will change it
                volatile sig_atomic_t dummyAtomic = 0;

                int32_t minimaxWinner =
                    theGame.MinMax(
                            heuristic,
                            g_depth,
                            Game1v1::e_Game1v1Player1,
                            resultPiece,
                            resultCoord,
                            dummyAtomic);

                // i18n TRANSLATORS: '%d' will be replaced here by the value of the winning
                // i18n move calculated by the minimax engine. Bear in mind the '\n' character
                // i18n should be there in the translated version of the string too
                // i18n Thank you for contributing to this project
                printf(_("Winning evaluation function value: %d\n"), minimaxWinner);

                if (resultPiece.GetType() == e_noPiece)
                {
                    std::cout << std::endl;
                    // i18n TRANSLATORS: This string will be printed on the screen when the minimax
                    // i18n engine cannot put down a piece. It is left up to the translator to decide
                    // i18n to decide the formatting of the message, though this english version
                    // i18n could be used as the template
                    // i18n Thank you for contributing to this project
                    std::cout << _(" ===================================================\n"\
                                   " === END OF THE GAME. NO PIECE COULD BE PUT DOWN ===\n"\
                                   " ===================================================\n");
                }
                else
                {
                    // out down the result piece on the board
                    theGame.PutDownPiece(
                            resultPiece,
                            resultCoord,
                            Game1v1::e_Game1v1Player1);

                    // print the final game on the screen
                    theGame.SaveGame(std::cout);
                }

                //theGame.GetMe().PrintNucleationPoints(std::cout);
                //theGame.GetOpponent().PrintNucleationPoints(std::cout);

            } // for (int32_t fileIndex = 0; g_blockemfilePath[fileIndex] != NULL; fileIndex++)
        }
        else // (g_mode != 1 && g_mode != 2)
        {
            snprintf(errorStringBuffer,
                     ERROR_STRING_BUFFER_SIZE,
                     // i18n TRANSLATORS: Please, leave that %d as it is. It will be replaced
                     // i18n by the mode picked by the user
                     // i18n Thank you for contributing to this project
                     _("Invalid --mode option (%d)"),
                     g_mode);

            FatalError(
                argv[0],
                errorStringBuffer,
                BAD_MODE_OPTION_ERR);
        }

        // CONSOLE mode
        //////////////////
    }

    return 0;
}