Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) K3-Op-Een-Rij source code (version 5.0)

 

K3-Op-Een-Rij version 5.0 source code.

 

 

 

 

 

Technical facts

 

Application type(s)

Operating system(s) or programming environment(s)

IDE(s):

Project type:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: GameK3OpEenRijWt.pro

 

#-------------------------------------------------
#
# Project created by QtCreator 2011-01-10T18:25:31
#
#-------------------------------------------------
QT       += core
QT       -= gui
LIBS += -lwt -lwthttp -lboost_filesystem
QMAKE_CXXFLAGS += -DNDEBUG
TARGET = GameK3OpEenRijWt
CONFIG   += console
CONFIG   -= app_bundle
TEMPLATE = app
SOURCES += mainwt.cpp \
    ../../Classes/CppAbout/about.cpp \
    ../../Classes/CppConnectThree/connectthree.cpp \
    ../../Classes/CppWtAboutDialog/wtaboutdialog.cpp \
    ../../Classes/CppWtConnectThreeWidget/wtconnectthreewidget.cpp \
    ../../Games/GameConnectThree/wtconnectthreedialog.cpp \
    ../../Games/GameConnectThree/wtconnectthreemenudialog.cpp \
    ../../Games/GameConnectThree/wtconnectthreegamedialog.cpp \
    ../../Games/GameConnectThree/wtselectplayerwidget.cpp \
    ../GameConnectThree/connectthreefilenames.cpp
HEADERS += \
    ../../Classes/CppAbout/about.h \
    ../../Classes/CppConnectThree/connectthree.h \
    ../../Classes/CppWtAboutDialog/wtaboutdialog.h \
    ../../Classes/CppWtConnectThreeWidget/wtconnectthreewidget.h \
    ../../Games/GameConnectThree/wtconnectthreedialog.h \
    ../../Games/GameConnectThree/wtconnectthreemenudialog.h \
    ../../Games/GameConnectThree/wtconnectthreegamedialog.h \
    ../../Games/GameConnectThree/wtselectplayerwidget.h \
    ../GameConnectThree/connectthreefilenames.h

OTHER_FILES += \
    K3OpEenRij.css

 

 

 

 

 

mainwt.cpp

 

//---------------------------------------------------------------------------
/*
K3-Op-Een-Rij. A simple game.
Copyright (C) 2007-2011 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/GameK3OpEenRij.htm
//---------------------------------------------------------------------------
#include <exception>
#include <iostream>
//---------------------------------------------------------------------------
#include <Wt/WApplication>
#include <Wt/WEnvironment>
//---------------------------------------------------------------------------
#include "../../Games/GameConnectThree/connectthreefilenames.h"
#include "../../Games/GameConnectThree/wtconnectthreedialog.h"
#include "../../Classes/CppAbout/about.h"
#include "../../Classes/CppConnectThree/connectthree.h"
#include "../../Classes/CppWtAboutDialog/wtaboutdialog.h"
#include "../../Classes/CppWtConnectThreeWidget/wtconnectthreewidget.h"
//---------------------------------------------------------------------------
struct K3OpEenRijApplication : public Wt::WApplication
{
  K3OpEenRijApplication(
    const Wt::WEnvironment& env,
    const About& about,
    const ConnectThreeFilenames& filenames)
    : Wt::WApplication(env)
  {
    this->setTitle("K3OpEenRij (C) 2007-2011 Richel Bilderbeek");
    this->useStyleSheet(filenames.m_css);
    root()->addWidget(new WtConnectThreeDialog(about,filenames,"K3OpEenRij"));
  }
};
//---------------------------------------------------------------------------
About CreateAbout()
{
  About about(
    "Richel Bilderbeek",
    "K3-Op-Een-Rij",
    "Connect-three game with a K3 theme",
    "the 10th of January 2011",
    "2007-2011",
    "http://www.richelbilderbeek.nl/GameK3OpEenRij.htm",
    WtConnectThreeDialog::GetVersion(),
    WtConnectThreeDialog::GetVersionHistory());
  about.AddLibrary("Wt version: " + std::string(WT_VERSION_STR));
  about.AddLibrary("ConnectThree version: " + ConnectThree::GetVersion());
  about.AddLibrary("WtConnectThreeWidget version: " + WtConnectThreeWidget::GetVersion());
  about.AddLibrary("WtAboutDialog version: " + WtAboutDialog::GetVersion());
  return about;
}
//---------------------------------------------------------------------------
Wt::WApplication * createApplication(const Wt::WEnvironment& env)
{
  const ConnectThreeFilenames filenames(
    "K3OpEenRijBackground.png",
    "K3OpEenRijComputer1.png",
    "K3OpEenRijComputer2.png",
    "K3OpEenRijComputer3.png",
    "K3OpEenRijComputerGrey.png",
    "K3OpEenRij.css",
    "K3OpEenRijEmpty.png",
    "K3OpEenRijPlayer1.png",
    "K3OpEenRijPlayer1Grey.png",
    "K3OpEenRijPlayer2.png",
    "K3OpEenRijPlayer2Grey.png",
    "K3OpEenRijPlayer3.png",
    "K3OpEenRijPlayer3Grey.png");
  return new K3OpEenRijApplication(env,CreateAbout(),filenames);
}
//---------------------------------------------------------------------------
int main(int argc, char **argv)
{
  try
  {
    return Wt::WRun(argc, argv, &createApplication);
  }
  catch (std::exception& e)
  {
    std::cerr << e.what() << '\n';
    std::clog << e.what() << '\n';
    std::cout << e.what() << '\n';
    return 1;
  }
}
//---------------------------------------------------------------------------

 

 

 

 

 

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict