Go back to Richel Bilderbeek's homepage.

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

 

 

 

 

 

(C++) TestPylos

 

TestPylos is a tool to test the Pylos (also called 'Pyraos') and PylosWidget classes.

 

TestPylos was the start of my Pylos game.

 

TestPylos is programmed in C++ using the IDE Qt Creator. It uses the Boost, Qt and STL libraries.

 

 

 

 

Downloads

 

 

 

 

 

 

Older downloads

 

Technical facts

 

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: ./ToolTestPylos/ToolTestPylosDesktop.pro

 

include(../../DesktopApplication.pri)
include(../../Libraries/Boost.pri)

include(../../Libraries/GeneralConsole.pri)
include(../../Libraries/GeneralDesktop.pri)

include(../../Classes/CppCanvas/CppCanvas.pri)
include(../../Classes/CppDotMatrix/CppDotMatrix.pri)
include(../../Classes/CppImageCanvas/CppImageCanvas.pri)
include(../../Classes/CppPylos/CppPylos.pri)
include(../../Classes/CppTextCanvas/CppTextCanvas.pri)

include(../../Classes/CppQtPylos/CppQtPylos.pri)

include(ToolTestPylosDesktop.pri)

SOURCES += \
    qtmain.cpp

 

 

 

 

 

./ToolTestPylos/ToolTestPylosConsole.pri

 

INCLUDEPATH += \
    ../../Tools/ToolTestPylos

SOURCES += \
    ../../Tools/ToolTestPylos/testpylosmenudialog.cpp

HEADERS += \
    ../../Tools/ToolTestPylos/testpylosmenudialog.h

OTHER_FILES += \
    ../../Tools/ToolTestPylos/Licence.txt

RESOURCES += \
    ../../Tools/ToolTestPylos/ToolTestPylos.qrc

 

 

 

 

 

./ToolTestPylos/ToolTestPylosDesktop.pri

 

include(../../Tools/ToolTestPylos/ToolTestPylosConsole.pri)

FORMS += \
    ../../Tools/ToolTestPylos/qttestpylostestgamedialog.ui \
    ../../Tools/ToolTestPylos/qttestpylostestboarddialog.ui \
    ../../Tools/ToolTestPylos/qttestpylosrandomplaydialog.ui \
    ../../Tools/ToolTestPylos/qttestpylosmenudialog.ui \
    ../../Tools/ToolTestPylos/qttestpylosgametestsdialog.ui

SOURCES += \
    ../../Tools/ToolTestPylos/qttestpylostestgamedialog.cpp \
    ../../Tools/ToolTestPylos/qttestpylostestboarddialog.cpp \
    ../../Tools/ToolTestPylos/qttestpylosrandomplaydialog.cpp \
    ../../Tools/ToolTestPylos/qttestpylosmenudialog.cpp \
    ../../Tools/ToolTestPylos/qttestpylosgametestsdialog.cpp

HEADERS += \
    ../../Tools/ToolTestPylos/qttestpylostestgamedialog.h \
    ../../Tools/ToolTestPylos/qttestpylostestboarddialog.h \
    ../../Tools/ToolTestPylos/qttestpylosrandomplaydialog.h \
    ../../Tools/ToolTestPylos/qttestpylosmenudialog.h \
    ../../Tools/ToolTestPylos/qttestpylosgametestsdialog.h

 

 

 

 

 

./ToolTestPylos/ToolTestPylosWebsite.pri

 

include(../../Tools/ToolTestPylos/ToolTestPylosConsole.pri)
SOURCES +=
HEADERS +=

 

 

 

 

 

./ToolTestPylos/qtmain.cpp

 

//---------------------------------------------------------------------------
/*
TestPylos, tool to test the Pylos classes
Copyright (C) 2010-2012 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/ToolTestPylos.htm
//---------------------------------------------------------------------------
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#include <QApplication>
#include "pylosboard.h"
#include "pyloscoordinat.h"
#include "pyloscurrentmovestate.h"
#include "pylosgame.h"
#include "pylosmove.h"

#include "qttestpylosmenudialog.h"
#include "trace.h"
#pragma GCC diagnostic pop

///TODO
///- allow a Player to pass turn when he/she has no marble
///- add tooltips to widget
///- add investigation of winners
int main(int argc, char *argv[])
{
  QApplication a(argc, argv);
  START_TRACE();
  ribi::pylos::QtTestPylosMenuDialog w;
  w.show();
  return a.exec();
}

 

 

 

 

 

./ToolTestPylos/qttestpylosgametestsdialog.h

 

//---------------------------------------------------------------------------
/*
TestPylos, tool to test the Pylos classes
Copyright (C) 2010-2014 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/ToolTestPylos.htm
//---------------------------------------------------------------------------
#ifndef QTTESTPYLOSGAMETESTSDIALOG_H
#define QTTESTPYLOSGAMETESTSDIALOG_H

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#include "qthideandshowdialog.h"
#pragma GCC diagnostic pop

namespace Ui {
  class QtTestPylosGameTestsDialog;
}

namespace ribi {

///DialogTests shows some of the more elaborate tests that
///are performed on the Pylos class
class QtTestPylosGameTestsDialog : public QtHideAndShowDialog
{
  Q_OBJECT

public:
  explicit QtTestPylosGameTestsDialog(QWidget *parent = 0);
  QtTestPylosGameTestsDialog(const QtTestPylosGameTestsDialog&) = delete;
  QtTestPylosGameTestsDialog& operator=(const QtTestPylosGameTestsDialog&) = delete;
  ~QtTestPylosGameTestsDialog() noexcept;

private:
  Ui::QtTestPylosGameTestsDialog *ui;
};

} //~namespace ribi

#endif // QTTESTPYLOSGAMETESTSDIALOG_H

 

 

 

 

 

./ToolTestPylos/qttestpylosgametestsdialog.cpp

 

//---------------------------------------------------------------------------
/*
TestPylos, tool to test the Pylos classes
Copyright (C) 2010-2014 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/ToolTestPylos.htm
//---------------------------------------------------------------------------
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#include "qttestpylosgametestsdialog.h"
#include "ui_qttestpylosgametestsdialog.h"
#pragma GCC diagnostic pop

ribi::QtTestPylosGameTestsDialog::QtTestPylosGameTestsDialog(QWidget *parent)
  : QtHideAndShowDialog(parent),
    ui(new Ui::QtTestPylosGameTestsDialog)
{
  ui->setupUi(this);
}

ribi::QtTestPylosGameTestsDialog::~QtTestPylosGameTestsDialog() noexcept
{
  delete ui;
}

 

 

 

 

 

./ToolTestPylos/qttestpylosmenudialog.h

 

//---------------------------------------------------------------------------
/*
TestPylos, tool to test the Pylos classes
Copyright (C) 2010-2014 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/ToolTestPylos.htm
//---------------------------------------------------------------------------
#ifndef QTTESTPYLOSMENUDIALOG_H
#define QTTESTPYLOSMENUDIALOG_H

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#include "qthideandshowdialog.h"
#pragma GCC diagnostic pop

namespace Ui {
  class QtTestPylosMenuDialog;
}

namespace ribi {
namespace pylos {

class QtTestPylosMenuDialog : public QtHideAndShowDialog
{
    Q_OBJECT

public:
  explicit QtTestPylosMenuDialog(QWidget *parent = 0);
  QtTestPylosMenuDialog(const QtTestPylosMenuDialog&) = delete;
  QtTestPylosMenuDialog& operator=(const QtTestPylosMenuDialog&) = delete;
  ~QtTestPylosMenuDialog() noexcept;

private slots:
  void on_button_test_board_clicked();
  void on_button_test_game_clicked();
  void on_button_show_game_tests_clicked();
  void on_button_about_clicked();
  void on_button_quit_clicked();
  void on_button_random_play_clicked();

private:
  Ui::QtTestPylosMenuDialog *ui;

  #ifndef NDEBUG
  static void Test() noexcept;
  #endif
};

} //~namespace pylos
} //~namespace ribi

#endif // QTTESTPYLOSMENUDIALOG_H

 

 

 

 

 

./ToolTestPylos/qttestpylosmenudialog.cpp

 

//---------------------------------------------------------------------------
/*
TestPylos, tool to test the Pylos classes
Copyright (C) 2010-2014 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/ToolTestPylos.htm
//---------------------------------------------------------------------------
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#include "qttestpylosmenudialog.h"

#include "qtaboutdialog.h"
#include "qttestpylostestboarddialog.h"
#include "qttestpylostestgamedialog.h"
#include "qttestpylosgametestsdialog.h"
#include "qttestpylosrandomplaydialog.h"
#include "testpylosmenudialog.h"
#include "trace.h"
#include "ui_qttestpylosmenudialog.h"
#pragma GCC diagnostic pop

ribi::pylos::QtTestPylosMenuDialog::QtTestPylosMenuDialog(QWidget *parent) :
    QtHideAndShowDialog(parent),
    ui(new Ui::QtTestPylosMenuDialog)
{
  #ifndef NDEBUG
  Test();
  #endif
  ui->setupUi(this);
}

ribi::pylos::QtTestPylosMenuDialog::~QtTestPylosMenuDialog() noexcept
{
    delete ui;
}

void ribi::pylos::QtTestPylosMenuDialog::on_button_test_board_clicked()
{
  QtTestPylosTestBoardDialog d;
  this->ShowChild(&d);
}

void ribi::pylos::QtTestPylosMenuDialog::on_button_test_game_clicked()
{
  QtTestPylosTestGameDialog d;
  this->ShowChild(&d);
}

void ribi::pylos::QtTestPylosMenuDialog::on_button_show_game_tests_clicked()
{
  QtTestPylosGameTestsDialog d;
  this->ShowChild(&d);
}

void ribi::pylos::QtTestPylosMenuDialog::on_button_about_clicked()
{
  QtAboutDialog d(TestPylosMenuDialog().GetAbout());
  this->ShowChild(&d);
}

void ribi::pylos::QtTestPylosMenuDialog::on_button_quit_clicked()
{
  close();
}

void ribi::pylos::QtTestPylosMenuDialog::on_button_random_play_clicked()
{
  QtTestPylosRandomPlayDialog d;
  this->ShowChild(&d);
}

#ifndef NDEBUG
void ribi::pylos::QtTestPylosMenuDialog::Test() noexcept
{
  {
    static bool is_tested = false;
    if (is_tested) return;
    is_tested = true;
  }
  TRACE("Starting ribi::pylos::QtTestPylosMenuDialog::Test");
  TRACE("Finished ribi::pylos::QtTestPylosMenuDialog::Test successfully");
}
#endif

 

 

 

 

 

./ToolTestPylos/qttestpylosrandomplaydialog.h

 

//---------------------------------------------------------------------------
/*
TestPylos, tool to test the Pylos classes
Copyright (C) 2010-2014 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/ToolTestPylos.htm
//---------------------------------------------------------------------------
#ifndef QTTESTPYLOSRANDOMPLAYDIALOG_H
#define QTTESTPYLOSRANDOMPLAYDIALOG_H

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#include "qthideandshowdialog.h"
#pragma GCC diagnostic pop

namespace Ui {
  class QtTestPylosRandomPlayDialog;
}


namespace ribi {
namespace pylos {

class QtTestPylosRandomPlayDialog : public QtHideAndShowDialog
{
  Q_OBJECT
    
public:
  explicit QtTestPylosRandomPlayDialog(QWidget *parent = 0);
  QtTestPylosRandomPlayDialog(const QtTestPylosRandomPlayDialog&) = delete;
  QtTestPylosRandomPlayDialog& operator=(const QtTestPylosRandomPlayDialog&) = delete;
  ~QtTestPylosRandomPlayDialog() noexcept;
    
private slots:
    void on_button_start_clicked();
    void on_edit_n_games_textChanged(const QString &arg1);

private:
  Ui::QtTestPylosRandomPlayDialog *ui;
};

} //~namespace pylos
} //~namespace ribi

#endif // QTTESTPYLOSRANDOMPLAYDIALOG_H

 

 

 

 

 

./ToolTestPylos/qttestpylosrandomplaydialog.cpp

 

//---------------------------------------------------------------------------
/*
TestPylos, tool to test the Pylos classes
Copyright (C) 2010-2014 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/ToolTestPylos.htm
//---------------------------------------------------------------------------
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#include "qttestpylosrandomplaydialog.h"

#include <boost/lexical_cast.hpp>

#include "pylosboard.h"
#include "pylosgame.h"
#include "ui_qttestpylosrandomplaydialog.h"
#pragma GCC diagnostic pop

ribi::pylos::QtTestPylosRandomPlayDialog::QtTestPylosRandomPlayDialog(QWidget *parent) :
  QtHideAndShowDialog(parent),
  ui(new Ui::QtTestPylosRandomPlayDialog)
{
  ui->setupUi(this);
}

ribi::pylos::QtTestPylosRandomPlayDialog::~QtTestPylosRandomPlayDialog() noexcept
{
  delete ui;
}

void ribi::pylos::QtTestPylosRandomPlayDialog::on_button_start_clicked()
{
  const boost::shared_ptr<Board> board = (ui->radio_advanced->isChecked()
    ? Board::CreateAdvancedBoard()
    : Board::CreateBasicBoard() );

  int won1 = 0;
  int won2 = 0;

  ui->bar_progress->setValue(0);
  ui->bar_won_player1->setValue(0);

  const int max = boost::lexical_cast<int>(ui->edit_n_games->text().toStdString());

  for (int i=0; i!=max; ++i)
  {
    const Winner winner = Game::PlayRandomGame(board);
    if (winner == Winner::player1) ++won1; else ++won2;
    ui->bar_progress->setValue(i);
    ui->bar_won_player1->setValue(
      static_cast<int>(
      100.0 * static_cast<double>(won1) / static_cast<double>(i) ) );
  }

  ui->bar_progress->setValue(max);
}

void ribi::pylos::QtTestPylosRandomPlayDialog::on_edit_n_games_textChanged(const QString &arg1)
{
  try
  {
    boost::lexical_cast<int>(arg1.toStdString());
  }
  catch (boost::bad_lexical_cast&)
  {
    ui->button_start->setEnabled(false);
    return;
  }
  ui->bar_progress->setMaximum(boost::lexical_cast<int>(arg1.toStdString()));
  ui->button_start->setEnabled(true);
}

 

 

 

 

 

./ToolTestPylos/qttestpylostestboarddialog.h

 

//---------------------------------------------------------------------------
/*
TestPylos, tool to test the Pylos classes
Copyright (C) 2010-2014 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/ToolTestPylos.htm
//---------------------------------------------------------------------------
#ifndef QTTESTPYLOSTESTBOARDDIALOG_H
#define QTTESTPYLOSTESTBOARDDIALOG_H

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#include <boost/shared_ptr.hpp>

#include "qthideandshowdialog.h"

#include "pylosmove.h"
#include "pylosboard.h"
#include "qtpylosboardwidget.h"
#pragma GCC diagnostic pop

struct QLabel;
struct QTimer;
namespace Ui {
  class QtTestPylosTestBoardDialog;
}

namespace ribi {
namespace pylos {

class QtTestPylosTestBoardDialog : public QtHideAndShowDialog
{
  Q_OBJECT

public:
  explicit QtTestPylosTestBoardDialog(QWidget *parent = 0);
  QtTestPylosTestBoardDialog(const QtTestPylosTestBoardDialog&) = delete;
  QtTestPylosTestBoardDialog& operator=(const QtTestPylosTestBoardDialog&) = delete;
  ~QtTestPylosTestBoardDialog() noexcept;

protected:
  

private:
  Ui::QtTestPylosTestBoardDialog *ui;
  boost::shared_ptr<QtPylosBoardWidget> m_widget;
  QTimer * m_timer;

private slots:
  ///OnTimer is called when the auto-play/demo mode clicks randomly
  void OnTimer();

  ///When something changes, the log must be updated
  void UpdateLog();

  void on_button_play_visual_clicked();
  void on_radio_advanced_clicked();
  void on_radio_basic_clicked();
  void on_radio_bw_clicked();
  void on_radio_rb_clicked();
  void on_radio_set_player1_clicked();
  void on_radio_set_player2_clicked();

  void on_slider_tilt_sliderMoved(int position);
};

} //~namespace pylos
} //~namespace ribi

#endif // QTTESTPYLOSTESTBOARDDIALOG_H

 

 

 

 

 

./ToolTestPylos/qttestpylostestboarddialog.cpp

 

//---------------------------------------------------------------------------
/*
TestPylos, tool to test the Pylos classes
Copyright (C) 2010-2014 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/ToolTestPylos.htm
//---------------------------------------------------------------------------
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#include "qttestpylostestboarddialog.h"

#include <cassert>
#include <iostream>

#include <boost/lexical_cast.hpp>
#include <boost/math/constants/constants.hpp>
#include <boost/numeric/conversion/cast.hpp>

#include <QBitmap>
#include <QMouseEvent>
#include <QPainter>
#include <QTimer>

#include "pylosboard.h"
#include "pylosmove.h"
#include "pylosmustremovestate.h"
#include "pylospositionstate.h"
#include "qtpylosboardwidget.h"
#include "ui_qttestpylostestboarddialog.h"

#pragma GCC diagnostic pop

#ifdef PYLOSGAME_H
#error Pylos::Game must not be used by a QtPylosTestBoard
#endif

ribi::pylos::QtTestPylosTestBoardDialog::QtTestPylosTestBoardDialog(QWidget *parent) :
  QtHideAndShowDialog(parent),
  ui(new Ui::QtTestPylosTestBoardDialog),
  m_widget(new QtPylosBoardWidget),
  m_timer(new QTimer(this))
{
  ui->setupUi(this);

  ui->widget_pylos_layout->addWidget(m_widget.get());

  //Connect the timer
  QObject::connect(
    m_timer,SIGNAL(timeout()),
    this,SLOT(OnTimer()));

  //When there's a winner, only the log needs to be informed
  QObject::connect(this->m_widget.get(),SIGNAL(HasWinner()),
    this,SLOT(UpdateLog()));
  //When one of the other selectors changes, only the log needs to be informed
  QObject::connect(this->m_widget.get(),SIGNAL(Toggle()),
    this,SLOT(UpdateLog()));
  //When the selector changes, only the log needs to be informed
  QObject::connect(this->m_widget.get(),SIGNAL(SelectorChanged()),
    this,SLOT(UpdateLog()));
  //When the active player changes, only the log needs to be informed
  QObject::connect(this->m_widget.get(),SIGNAL(PlayerChanged()),
    this,SLOT(UpdateLog()));

  UpdateLog();
}

ribi::pylos::QtTestPylosTestBoardDialog::~QtTestPylosTestBoardDialog() noexcept
{
  m_timer->stop();
  delete ui;
}

void ribi::pylos::QtTestPylosTestBoardDialog::on_button_play_visual_clicked()
{
  if (m_timer->isActive())
  {
    //Disable timer
    m_timer->stop();
  }
  else
  {
    //Start timer
    if (m_widget->GetWinner() != Winner::none)
    {
      if ( (std::rand() >> 4) % 2)
      {
        ui->radio_advanced->click();
      }
      else
      {
        ui->radio_basic->click();
      }
    }
    m_timer->setInterval(10);
    m_timer->start();
  }
}

void ribi::pylos::QtTestPylosTestBoardDialog::OnTimer()
{
  //Click player
  if ((rand() >> 4) % 2) { ui->radio_set_player1->click(); } else { ui->radio_set_player2->click(); }

  const QRect r = this->m_widget->geometry();
  const int x = r.left() + (std::rand() % r.width());
  const int y = r.top()  + (std::rand() % r.height());
  QPoint pos(x,y);
  boost::shared_ptr<QMouseEvent> e;
  e.reset(new QMouseEvent(
    QEvent::MouseMove,
    pos,
    Qt::NoButton,
    Qt::NoButton,
    Qt::NoModifier));
  m_widget->mouseMoveEvent(e.get());
  if ((std::rand() >> 4) % 2)
  {
    e.reset(new QMouseEvent(
      QEvent::MouseButtonPress,
      pos,
      Qt::LeftButton,
      Qt::LeftButton,
      Qt::NoModifier));
  }
  else
  {
    e.reset(new QMouseEvent(
      QEvent::MouseButtonPress,
      pos,
      Qt::RightButton,
      Qt::RightButton,
      Qt::NoModifier));
  }
  this->m_widget->mousePressEvent(e.get());

  if (m_widget->GetWinner() != Winner::none)
  {
    m_timer->stop();
  }
}

void ribi::pylos::QtTestPylosTestBoardDialog::on_radio_set_player1_clicked()
{
  if (m_widget->CanSetPlayer(Player::player1))
  {
    m_widget->SetPlayer(Player::player1);
  }
  else
  {
    ui->radio_set_player2->setChecked(true);
  }
}

void ribi::pylos::QtTestPylosTestBoardDialog::on_radio_set_player2_clicked()
{
  if (m_widget->CanSetPlayer(Player::player2))
  {
    m_widget->SetPlayer(Player::player2);
  }
  else
  {
    ui->radio_set_player1->setChecked(true);
  }
}

void ribi::pylos::QtTestPylosTestBoardDialog::on_radio_advanced_clicked()
{
  m_widget->StartAdvanced();
}

void ribi::pylos::QtTestPylosTestBoardDialog::on_radio_basic_clicked()
{
  m_widget->StartBasic();
}

void ribi::pylos::QtTestPylosTestBoardDialog::on_radio_bw_clicked()
{
  m_widget->SetColorSchemeBlackWhite();
}

void ribi::pylos::QtTestPylosTestBoardDialog::on_radio_rb_clicked()
{
  m_widget->SetColorSchemeRedBlue();
}

void ribi::pylos::QtTestPylosTestBoardDialog::UpdateLog()
{
  ui->text_log->clear();

  ui->text_log->appendPlainText(
    QString("Selector coordinat: ")
    + QString(m_widget->GetSelector().ToStr().c_str()));

  ui->bar1->setValue(m_widget->GetBoard()->Count(PositionState::player1));
  ui->bar2->setValue(m_widget->GetBoard()->Count(PositionState::player2));

  {
    std::string s = "Other selectors' coordinats: ";
    const std::vector<Coordinat>& v
      = m_widget->GetOtherSelectors();
    if (v.empty()) { s+="none"; }
    if (v.size() > 0) { s+= v[0].ToStr(); }
    if (v.size() == 2) { s+= " and " + v[1].ToStr(); }
    ui->text_log->appendPlainText(s.c_str());
  }
  {
    const std::string s = "Must remove: " + ToStr(m_widget->GetMustRemove());
    ui->text_log->appendPlainText(s.c_str());
  }
  {
    const std::string s = "Winner: " + ToStr(m_widget->GetWinner());
    ui->text_log->appendPlainText(s.c_str());
  }
  {
    const std::vector<Move> v = m_widget->GetBoard()->GetAllPossibleMoves(
      ui->radio_set_player1->isChecked()
      ? Player::player1 : Player::player2);
    const std::size_t sz = v.size();
    {
      const std::string s = "#moves: " + boost::lexical_cast<std::string>(sz) ;
      ui->text_log->appendPlainText(s.c_str());
    }

    for (std::size_t i=0; i!=sz; ++i)
    {
      const std::string s = boost::lexical_cast<std::string>(i)
        + ": " + v[i].ToStr();
      ui->text_log->appendPlainText(s.c_str());
    }
  }
}

void ribi::pylos::QtTestPylosTestBoardDialog::on_slider_tilt_sliderMoved(int position)
{
  const double pi = boost::math::constants::pi<double>();
  const double radians = (static_cast<double>(position) * 2.0 * pi) / 360.0;
  this->m_widget->SetTilt(radians);
  {
    const std::string s = "Tilt: " + boost::lexical_cast<std::string>(radians)
      + " radians (" + boost::lexical_cast<std::string>(position)
      + " degrees)";
    ui->slider_tilt->setToolTip(s.c_str());
  }
}

 

 

 

 

 

./ToolTestPylos/qttestpylostestgamedialog.h

 

//---------------------------------------------------------------------------
/*
TestPylos, tool to test the Pylos classes
Copyright (C) 2010-2014 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/ToolTestPylos.htm
//---------------------------------------------------------------------------
#ifndef QTTESTPYLOSTESTGAMEDIALOG_H
#define QTTESTPYLOSTESTGAMEDIALOG_H

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#include <boost/shared_ptr.hpp>
#include "qthideandshowdialog.h"
#pragma GCC diagnostic pop

struct QLabel;
struct QTimer;

namespace Ui {
  class QtTestPylosTestGameDialog;
}


namespace ribi {
namespace pylos {

struct QtPylosGameWidget;

class QtTestPylosTestGameDialog : public QtHideAndShowDialog
{
  Q_OBJECT

public:
  explicit QtTestPylosTestGameDialog(QWidget *parent = 0);
  QtTestPylosTestGameDialog(const QtTestPylosTestGameDialog&) = delete;
  QtTestPylosTestGameDialog& operator=(const QtTestPylosTestGameDialog&) = delete;
  ~QtTestPylosTestGameDialog() noexcept;

protected:
  

private:
  Ui::QtTestPylosTestGameDialog *ui;
  boost::shared_ptr<QtPylosGameWidget> m_widget;
  QTimer * m_timer;

private slots:
  ///OnTimer is called when the auto-play/demo mode clicks randomly
  void OnTimer();

  ///When something changes, the log must be updated
  void UpdateLog();

  void on_button_play_visual_clicked();
  void on_radio_advanced_clicked();
  void on_radio_basic_clicked();
  void on_radio_bw_clicked();
  void on_radio_rb_clicked();

};

} //~namespace pylos
} //~namespace ribi

#endif // QTTESTPYLOSTESTGAMEDIALOG_H

 

 

 

 

 

./ToolTestPylos/qttestpylostestgamedialog.cpp

 

//---------------------------------------------------------------------------
/*
TestPylos, tool to test the Pylos classes
Copyright (C) 2010-2014 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/ToolTestPylos.htm
//---------------------------------------------------------------------------
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#include "qttestpylostestgamedialog.h"

#include <cassert>
#include <iostream>

#include <boost/numeric/conversion/cast.hpp>
#include <boost/lexical_cast.hpp>

#include <QBitmap>
#include <QMouseEvent>
#include <QPainter>
#include <QTimer>

#include "pylosgame.h"
#include "pylosboard.h"
#include "pylosmove.h"
#include "pylospositionstate.h"
#include "qtpylosboardwidget.h"
#include "qtpylosgamewidget.h"
#include "ui_qttestpylostestgamedialog.h"
#pragma GCC diagnostic pop

ribi::pylos::QtTestPylosTestGameDialog::QtTestPylosTestGameDialog(QWidget *parent) :
  QtHideAndShowDialog(parent),
  ui(new Ui::QtTestPylosTestGameDialog),
  m_widget(new QtPylosGameWidget),
  m_timer(new QTimer(this))
{
  ui->setupUi(this);

  ui->widget_pylos_layout->addWidget(m_widget.get());

  //Connect the timer
  QObject::connect(
    m_timer,SIGNAL(timeout()),
    this,SLOT(OnTimer()));

  //When there's a winner, only the log needs to be informed
  QObject::connect(this->m_widget.get(),SIGNAL(HasWinner()),
    this,SLOT(UpdateLog()));
  //When one of the other selectors changes, only the log needs to be informed
  QObject::connect(this->m_widget.get(),SIGNAL(Toggle()),
    this,SLOT(UpdateLog()));
  //When the selector changes, only the log needs to be informed
  QObject::connect(this->m_widget.get(),SIGNAL(SelectorChanged()),
    this,SLOT(UpdateLog()));
  //When the active player changes, only the log needs to be informed
  QObject::connect(this->m_widget.get(),SIGNAL(DoneMove()),
    this,SLOT(UpdateLog()));

  UpdateLog();
}

ribi::pylos::QtTestPylosTestGameDialog::~QtTestPylosTestGameDialog() noexcept
{
  m_timer->stop();
  delete ui;
}

void ribi::pylos::QtTestPylosTestGameDialog::on_button_play_visual_clicked()
{
  if (m_timer->isActive())
  {
    //Disable timer
    m_timer->stop();
  }
  else
  {
    //Start timer
    if (m_widget->GetWinner() != pylos::Winner::none)
    {
      if ( (std::rand() >> 4) % 2)
      {
        ui->radio_advanced->click();
      }
      else
      {
        ui->radio_basic->click();
      }
    }
    m_timer->setInterval(10);
    m_timer->start();
  }
}

void ribi::pylos::QtTestPylosTestGameDialog::OnTimer()
{
  const QRect r = this->m_widget->geometry();
  const int x = r.left() + (std::rand() % r.width());
  const int y = r.top()  + (std::rand() % r.height());
  QPoint pos(x,y);
  boost::shared_ptr<QMouseEvent> e;
  e.reset(new QMouseEvent(
    QEvent::MouseMove,
    pos,
    Qt::NoButton,
    Qt::NoButton,
    Qt::NoModifier));
  m_widget->mouseMoveEvent(e.get());
  if ((std::rand() >> 4) % 2)
  {
    e.reset(new QMouseEvent(
      QEvent::MouseButtonPress,
      pos,
      Qt::LeftButton,
      Qt::LeftButton,
      Qt::NoModifier));
  }
  else
  {
    e.reset(new QMouseEvent(
      QEvent::MouseButtonPress,
      pos,
      Qt::RightButton,
      Qt::RightButton,
      Qt::NoModifier));
  }
  this->m_widget->mousePressEvent(e.get());

  if (m_widget->GetWinner() != pylos::Winner::none)
  {
    m_timer->stop();
  }
}

void ribi::pylos::QtTestPylosTestGameDialog::on_radio_advanced_clicked()
{
  m_widget->StartAdvanced();
}

void ribi::pylos::QtTestPylosTestGameDialog::on_radio_basic_clicked()
{
  m_widget->StartBasic();
}

void ribi::pylos::QtTestPylosTestGameDialog::on_radio_bw_clicked()
{
  m_widget->SetColorSchemeBlackWhite();
}

void ribi::pylos::QtTestPylosTestGameDialog::on_radio_rb_clicked()
{
  m_widget->SetColorSchemeRedBlue();
}

void ribi::pylos::QtTestPylosTestGameDialog::UpdateLog()
{
  ui->text_log->clear();

  ui->text_log->appendPlainText(
    QString("Selector coordinat: ")
    + QString(m_widget->GetSelector().ToStr().c_str()));

  ui->bar1->setValue(m_widget->GetPylos()->GetBoard()->Count(PositionState::player1));
  ui->bar2->setValue(m_widget->GetPylos()->GetBoard()->Count(PositionState::player2));

  {
    std::string s = "Other selectors' coordinats: ";
    const std::vector<Coordinat>& v
      = m_widget->GetOtherSelectors();
    if (v.empty()) { s+="none"; }
    if (v.size() > 0) { s+= v[0].ToStr(); }
    if (v.size() == 2) { s+= " and " + v[1].ToStr(); }
    ui->text_log->appendPlainText(s.c_str());
  }
  {
    const std::string s = "Must remove: " + ToStr(m_widget->GetMustRemove());
    ui->text_log->appendPlainText(s.c_str());
  }
  {
    const std::string s = "Winner: " + ToStr(m_widget->GetWinner());
    ui->text_log->appendPlainText(s.c_str());
  }
  {
    const std::vector<Move> v = m_widget->GetPylos()->GetAllPossibleMoves();
    const std::size_t sz = v.size();
    {
      const std::string s = "#moves: " + boost::lexical_cast<std::string>(sz) ;
      ui->text_log->appendPlainText(s.c_str());
    }

    for (std::size_t i=0; i!=sz; ++i)
    {
      const std::string s = boost::lexical_cast<std::string>(i)
        + ": " + v[i].ToStr();
      ui->text_log->appendPlainText(s.c_str());
    }
  }
  {
    ui->text_log->appendPlainText("");
    ui->text_log->appendPlainText("Move history:");
    const std::vector<Move> v = m_widget->GetPylos()->GetMoveHistory();
    const std::size_t sz = v.size();
    for (std::size_t i=0; i!=sz; ++i)
    {
      const std::string s = boost::lexical_cast<std::string>(i)
        + ". " + v[i].ToStr();
      ui->text_log->appendPlainText(s.c_str());
    }
  }

}

 

 

 

 

 

./ToolTestPylos/testpylosmenudialog.h

 

//---------------------------------------------------------------------------
/*
TestPylos, tool to test the Pylos classes
Copyright (C) 2010-2014 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/ToolTestPylos.htm
//---------------------------------------------------------------------------
#ifndef TESTPYLOSMAINDIALOG_H
#define TESTPYLOSMAINDIALOG_H

#include "menudialog.h"

namespace ribi {

struct TestPylosMenuDialog : public MenuDialog
{
  About GetAbout() const noexcept;
  Help GetHelp() const noexcept;
  boost::shared_ptr<const Program> GetProgram() const noexcept;
  std::string GetVersion() const noexcept;
  std::vector<std::string> GetVersionHistory() const noexcept;

  private:
  int ExecuteSpecific(const std::vector<std::string>& argv) noexcept;

  #ifndef NDEBUG
  static void Test() noexcept;
  #endif
};

} //~namespace ribi

#endif // TESTPYLOSMAINDIALOG_H

 

 

 

 

 

./ToolTestPylos/testpylosmenudialog.cpp

 

//---------------------------------------------------------------------------
/*
TestPylos, tool to test the Pylos classes
Copyright (C) 2010-2014 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/ToolTestPylos.htm
//---------------------------------------------------------------------------
#include "testpylosmenudialog.h"

#include <cassert>
#include <iostream>

#include "richelbilderbeekprogram.h"
#include "trace.h"

int ribi::TestPylosMenuDialog::ExecuteSpecific(const std::vector<std::string>& argv) noexcept
{
  #ifndef NDEBUG
  Test();
  #endif
  const int argc = static_cast<int>(argv.size());
  if (argc == 1)
  {
    std::cout << GetHelp() << '\n';
    return 1;
  }
  assert(!"TODO");
  return 1;
}

ribi::About ribi::TestPylosMenuDialog::GetAbout() const noexcept
{
  About a(
    "Richel Bilderbeek",
    "TestPylos",
    "tool to test the Pylos board classes",
    "the 29th of April 2012",
    "2010-2014",
    "http://www.richelbilderbeek.nl/ToolTestPylos.htm",
    GetVersion(),
    GetVersionHistory());
  //a.AddLibrary("QtDialWidget version: " + QtDialWidget::GetVersion());
  return a;
}

ribi::Help ribi::TestPylosMenuDialog::GetHelp() const noexcept
{
  return Help(
    this->GetAbout().GetFileTitle(),
    this->GetAbout().GetFileDescription(),
    {

    },
    {

    }
  );
}

boost::shared_ptr<const ribi::Program> ribi::TestPylosMenuDialog::GetProgram() const noexcept
{
  const boost::shared_ptr<const Program> p {
    new ProgramTestPylos
  };
  assert(p);
  return p;
}

std::string ribi::TestPylosMenuDialog::GetVersion() const noexcept
{
  return "2.1";
}

std::vector<std::string> ribi::TestPylosMenuDialog::GetVersionHistory() const noexcept
{
  return {
    "2010-09-19: version 0.1: initial version: cannot move marbles, cannot switch to advanced game, winner can be requested clumsily (by clicking next to the Pylos widget)",
    "2010-09-21: version 0.2: major architectural rewrite, PylosWidget now sends custom signals, due to which TestPylos can show more state",
    "2010-09-21: version 0.3: user can switch between basic and advanced play, user can now move marbles to a higher level",
    "2010-09-22: version 1.0: initial release version, allow PylosWidget resizing, allow visual random play, play many random virtual games at startup, keep track of move history",
    "2010-09-22: version 1.1: modified PylosWidget to not display selector when somewon has won, added extra test",
    "2010-09-22: version 1.2: if a marble is selected for movement to a higher layer, the left mouse button must be pressed. When a marble is selected for movement, no marble will be placed by clicking the left mouse button"
    "2012-04-29: version 2.0: major architectural change. Seperated PylosGame from PylosBoard",
    "2013-11-05: version 2.1: conformized for ProjectRichelBilderbeekConsole"
  };
}

#ifndef NDEBUG
void ribi::TestPylosMenuDialog::Test() noexcept
{
  {
    static bool is_tested = false;
    if (is_tested) return;
    is_tested = true;
  }
  TRACE("Starting ribi::TestPylosMenuDialog::Test");
  TRACE("Finished ribi::TestPylosMenuDialog::Test successfully");
}
#endif

 

 

 

 

 

./ToolTestPylos/zip.sh

 

#!/bin/sh

echo "Removing user information"
rm *.user

echo "Removing possible temp file"
rm copy.txt
rm tmp.txt


echo "Creating of all main folders"

mkdir temp_zip
mkdir temp_zip/Classes
mkdir temp_zip/Tools

echo "Creating of all subfolders"

mkdir temp_zip/Classes/CppAbout
mkdir temp_zip/Classes/CppPylos
mkdir temp_zip/Classes/CppQtAboutDialog
mkdir temp_zip/Classes/CppQtPylos
mkdir temp_zip/Classes/CppTrace
mkdir temp_zip/Tools/ToolTestPylos

echo "Copying files"

cp ../../Classes/CppAbout/Licence.txt temp_zip/Classes/CppAbout/Licence.txt
cp ../../Classes/CppAbout/about.cpp temp_zip/Classes/CppAbout/about.cpp
cp ../../Classes/CppAbout/about.h temp_zip/Classes/CppAbout/about.h
cp ../../Classes/CppPylos/Licence.txt temp_zip/Classes/CppPylos/Licence.txt
cp ../../Classes/CppPylos/pylosboard.cpp temp_zip/Classes/CppPylos/pylosboard.cpp
cp ../../Classes/CppPylos/pylosboard.h temp_zip/Classes/CppPylos/pylosboard.h
cp ../../Classes/CppPylos/pyloscoordinat.cpp temp_zip/Classes/CppPylos/pyloscoordinat.cpp
cp ../../Classes/CppPylos/pyloscoordinat.h temp_zip/Classes/CppPylos/pyloscoordinat.h
cp ../../Classes/CppPylos/pyloscurrentmovestate.cpp temp_zip/Classes/CppPylos/pyloscurrentmovestate.cpp
cp ../../Classes/CppPylos/pyloscurrentmovestate.h temp_zip/Classes/CppPylos/pyloscurrentmovestate.h
cp ../../Classes/CppPylos/pylosfwd.h temp_zip/Classes/CppPylos/pylosfwd.h
cp ../../Classes/CppPylos/pylosgame.cpp temp_zip/Classes/CppPylos/pylosgame.cpp
cp ../../Classes/CppPylos/pylosgame.h temp_zip/Classes/CppPylos/pylosgame.h
cp ../../Classes/CppPylos/pylosmove.cpp temp_zip/Classes/CppPylos/pylosmove.cpp
cp ../../Classes/CppPylos/pylosmove.h temp_zip/Classes/CppPylos/pylosmove.h
cp ../../Classes/CppPylos/pylosmustremovestate.cpp temp_zip/Classes/CppPylos/pylosmustremovestate.cpp
cp ../../Classes/CppPylos/pylosmustremovestate.h temp_zip/Classes/CppPylos/pylosmustremovestate.h
cp ../../Classes/CppPylos/pylosplayer.cpp temp_zip/Classes/CppPylos/pylosplayer.cpp
cp ../../Classes/CppPylos/pylosplayer.h temp_zip/Classes/CppPylos/pylosplayer.h
cp ../../Classes/CppPylos/pylospositionstate.cpp temp_zip/Classes/CppPylos/pylospositionstate.cpp
cp ../../Classes/CppPylos/pylospositionstate.h temp_zip/Classes/CppPylos/pylospositionstate.h
cp ../../Classes/CppPylos/pyloswinner.cpp temp_zip/Classes/CppPylos/pyloswinner.cpp
cp ../../Classes/CppPylos/pyloswinner.h temp_zip/Classes/CppPylos/pyloswinner.h
cp ../../Classes/CppQtAboutDialog/Licence.txt temp_zip/Classes/CppQtAboutDialog/Licence.txt
cp ../../Classes/CppQtAboutDialog/qtaboutdialog.cpp temp_zip/Classes/CppQtAboutDialog/qtaboutdialog.cpp
cp ../../Classes/CppQtAboutDialog/qtaboutdialog.h temp_zip/Classes/CppQtAboutDialog/qtaboutdialog.h
cp ../../Classes/CppQtAboutDialog/qtaboutdialog.ui temp_zip/Classes/CppQtAboutDialog/qtaboutdialog.ui
cp ../../Classes/CppQtPylos/Licence.txt temp_zip/Classes/CppQtPylos/Licence.txt
cp ../../Classes/CppQtPylos/qtpylosboardwidget.cpp temp_zip/Classes/CppQtPylos/qtpylosboardwidget.cpp
cp ../../Classes/CppQtPylos/qtpylosboardwidget.h temp_zip/Classes/CppQtPylos/qtpylosboardwidget.h
cp ../../Classes/CppQtPylos/qtpylosgamewidget.cpp temp_zip/Classes/CppQtPylos/qtpylosgamewidget.cpp
cp ../../Classes/CppQtPylos/qtpylosgamewidget.h temp_zip/Classes/CppQtPylos/qtpylosgamewidget.h
cp ../../Classes/CppQtPylos/qtpylossprites.cpp temp_zip/Classes/CppQtPylos/qtpylossprites.cpp
cp ../../Classes/CppQtPylos/qtpylossprites.h temp_zip/Classes/CppQtPylos/qtpylossprites.h
cp ../../Classes/CppQtPylos/qtpyloswidget.cpp temp_zip/Classes/CppQtPylos/qtpyloswidget.cpp
cp ../../Classes/CppQtPylos/qtpyloswidget.h temp_zip/Classes/CppQtPylos/qtpyloswidget.h
cp ../../Classes/CppTrace/Licence.txt temp_zip/Classes/CppTrace/Licence.txt
cp ../../Classes/CppTrace/trace.h temp_zip/Classes/CppTrace/trace.h
cp ../../Tools/ToolTestPylos/Licence.txt temp_zip/Tools/ToolTestPylos/Licence.txt
cp ../../Tools/ToolTestPylos/R.png temp_zip/Tools/ToolTestPylos/R.png
cp ../../Tools/ToolTestPylos/ToolTestPylos.pro temp_zip/Tools/ToolTestPylos/ToolTestPylos.pro
cp ../../Tools/ToolTestPylos/ToolTestPylos.qrc temp_zip/Tools/ToolTestPylos/ToolTestPylos.qrc
cp ../../Tools/ToolTestPylos/ToolTestPylosCanMove.png temp_zip/Tools/ToolTestPylos/ToolTestPylosCanMove.png
cp ../../Tools/ToolTestPylos/ToolTestPylosDoubleRemoveTest.png temp_zip/Tools/ToolTestPylos/ToolTestPylosDoubleRemoveTest.png
cp ../../Tools/ToolTestPylos/ToolTestPylosMoveMustRemove.png temp_zip/Tools/ToolTestPylos/ToolTestPylosMoveMustRemove.png
cp ../../Tools/ToolTestPylos/ToolTestPylosMustRemove.png temp_zip/Tools/ToolTestPylos/ToolTestPylosMustRemove.png
cp ../../Tools/ToolTestPylos/qtmain.cpp temp_zip/Tools/ToolTestPylos/qtmain.cpp
cp ../../Tools/ToolTestPylos/qttestpylosgametestsdialog.cpp temp_zip/Tools/ToolTestPylos/qttestpylosgametestsdialog.cpp
cp ../../Tools/ToolTestPylos/qttestpylosgametestsdialog.h temp_zip/Tools/ToolTestPylos/qttestpylosgametestsdialog.h
cp ../../Tools/ToolTestPylos/qttestpylosgametestsdialog.ui temp_zip/Tools/ToolTestPylos/qttestpylosgametestsdialog.ui
cp ../../Tools/ToolTestPylos/qttestpylosmenudialog.cpp temp_zip/Tools/ToolTestPylos/qttestpylosmenudialog.cpp
cp ../../Tools/ToolTestPylos/qttestpylosmenudialog.h temp_zip/Tools/ToolTestPylos/qttestpylosmenudialog.h
cp ../../Tools/ToolTestPylos/qttestpylosmenudialog.ui temp_zip/Tools/ToolTestPylos/qttestpylosmenudialog.ui
cp ../../Tools/ToolTestPylos/qttestpylosrandomplaydialog.cpp temp_zip/Tools/ToolTestPylos/qttestpylosrandomplaydialog.cpp
cp ../../Tools/ToolTestPylos/qttestpylosrandomplaydialog.h temp_zip/Tools/ToolTestPylos/qttestpylosrandomplaydialog.h
cp ../../Tools/ToolTestPylos/qttestpylosrandomplaydialog.ui temp_zip/Tools/ToolTestPylos/qttestpylosrandomplaydialog.ui
cp ../../Tools/ToolTestPylos/qttestpylostestboarddialog.cpp temp_zip/Tools/ToolTestPylos/qttestpylostestboarddialog.cpp
cp ../../Tools/ToolTestPylos/qttestpylostestboarddialog.h temp_zip/Tools/ToolTestPylos/qttestpylostestboarddialog.h
cp ../../Tools/ToolTestPylos/qttestpylostestboarddialog.ui temp_zip/Tools/ToolTestPylos/qttestpylostestboarddialog.ui
cp ../../Tools/ToolTestPylos/qttestpylostestgamedialog.cpp temp_zip/Tools/ToolTestPylos/qttestpylostestgamedialog.cpp
cp ../../Tools/ToolTestPylos/qttestpylostestgamedialog.h temp_zip/Tools/ToolTestPylos/qttestpylostestgamedialog.h
cp ../../Tools/ToolTestPylos/qttestpylostestgamedialog.ui temp_zip/Tools/ToolTestPylos/qttestpylostestgamedialog.ui
cp ../../Tools/ToolTestPylos/testpylosmenudialog.cpp temp_zip/Tools/ToolTestPylos/testpylosmenudialog.cpp
cp ../../Tools/ToolTestPylos/testpylosmenudialog.h temp_zip/Tools/ToolTestPylos/testpylosmenudialog.h

FILENAME="ToolTestPylosSource"
ZIP_FILENAME=$FILENAME".zip"

echo "Compressing files"

cd temp_zip
zip -r $FILENAME Classes
zip -r $FILENAME Tools
cd ..
cp "temp_zip/"$ZIP_FILENAME $ZIP_FILENAME

echo "Cleaning up"

echo "Emptying subfolders"

rm temp_zip/Classes/CppAbout/*.*
rm temp_zip/Classes/CppPylos/*.*
rm temp_zip/Classes/CppQtAboutDialog/*.*
rm temp_zip/Classes/CppQtPylos/*.*
rm temp_zip/Classes/CppTrace/*.*
rm temp_zip/Tools/ToolTestPylos/*.*

echo "Removing subfolders"

rmdir temp_zip/Classes/CppAbout
rmdir temp_zip/Classes/CppPylos
rmdir temp_zip/Classes/CppQtAboutDialog
rmdir temp_zip/Classes/CppQtPylos
rmdir temp_zip/Classes/CppTrace
rmdir temp_zip/Tools/ToolTestPylos

echo "Removing main folders"

rmdir temp_zip/Classes
rmdir temp_zip/Tools

echo "Removing temporary folder"

rm temp_zip/*.*
rmdir temp_zip

echo "Done"

# CreateQtProjectZipFile, version 1.2
# Copyright (C) 2012 Richel Bilderbeek
# Programmed on the 25th February 2012
# by Richel Bilderbeek
#
# CreateQtProjectZipFile can be downloaded from http://www.richelbilderbeek.nl/ToolCreateQtProjectZipFile.htm
# Licenced under GPL 3.0

 

 

 

 

 

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

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict

This page has been created by the tool CodeToHtml