[-]
[+]
|
Changed |
_service:tar_git:harbour-sailgo.spec
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/poetaster/SailGo.git</param>
<param name="branch">main</param>
- <param name="revision">0.4.0</param>
+ <param name="revision">0.5.0</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
|
Added |
_service:tar_git:harbour-sailgo-0.5.0.tar.bz2/Screenshot_2.png
^
|
|
Added |
_service:tar_git:harbour-sailgo-0.5.0.tar.bz2/Screenshot_3.png
^
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailgo-0.5.0.tar.bz2/harbour-sailgo.pro.user
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 4.15.2, 2022-01-05T18:58:43. -->
+<!-- Written by QtCreator 4.15.2, 2022-01-11T13:06:56. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
@@ -8,7 +8,7 @@
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
- <value type="int">2</value>
+ <value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
@@ -93,7 +93,7 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">SailfishOS-3.4.0.24-armv7hl (in Sailfish SDK Build Engine)</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">SailfishOS-3.4.0.24-armv7hl.default</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
- <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">1</value>
+ <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="int" key="EnableQmlDebugging">0</value>
@@ -770,8 +770,8 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">SailfishOS-4.3.0.12-aarch64 (in Sailfish SDK Build Engine)</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">SailfishOS-4.3.0.12-aarch64 (in Sailfish SDK Build Engine)</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{8066f8d8-13de-4c6d-a549-399237383095}</value>
- <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
- <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
+ <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
+ <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">1</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="int" key="EnableQmlDebugging">0</value>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailgo-0.5.0.tar.bz2/qml/elements/GoBoard.qml
^
|
@@ -52,6 +52,8 @@
if (debug) console.debug('squareState: ' + pieceState);
if (debug) console.debug('index: ' + model.index);
}
+
+ /* these are the edge and center markers */
GoPiece {
x: parent.width/3 + 2
y: parent.width/3 + 2
@@ -59,17 +61,6 @@
width:parent.width / 4
height:parent.width / 4
state: getMarkers(model.index)
- /*onStateChanged: {
- var markers = [42,48,133,139]
- if ( markers.indexOf(model.index) !== -1) {
- if (debug) console.debug('index: ' + model.index);
- currentMarker = "black"
- } else {
-
- }
-
- }*/
-
}
GoPiece {
@@ -79,7 +70,6 @@
state: area.containsMouse ? boardController.nextPlayer : "empty"
}
-
GoPiece {
anchors.centerIn: parent
width: parent.width
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailgo-0.5.0.tar.bz2/qml/sailfishos/pages/FirstPage.qml
^
|
@@ -35,7 +35,8 @@
Page {
id: page
- property var model: boardListModel
+ //property var model: boardListModel
+ property var model: boardController
SilicaFlickable {
id: flickable
@@ -86,6 +87,41 @@
width: Math.max(board.width * board.scale, flickable.width)
height: Math.max(board.height * board.scale, flickable.height)
+ Column {
+ id:totals
+ //model : boardListModel
+ width:parent.width
+ anchors.horizontalCenter: parent.Center
+ anchors.bottom: board.top
+
+ Row {
+ height: childrenRect.height
+ Label {
+ width: totals.width/4
+ text: qsTr("Black")
+ color: Theme.highlightColor
+ }
+ Label {
+ id: swart
+ property int count: 0
+ width: totals.width/4
+ //text: boardController.getBlacks()
+ text: boardController.blackTotal
+ }
+ Label {
+ width: totals.width/4
+ text: qsTr("White")
+ color: Theme.highlightColor
+ }
+ Label {
+ id: whit
+ width: totals.width/4
+ //text: boardController.getWhites()
+ text: qsTr(boardController.whiteTotal)
+ }
+ }
+ }
+
GoBoard {
id: board
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailgo-0.5.0.tar.bz2/src/common/abstractboardcontroller.cpp
^
|
@@ -21,9 +21,11 @@
}
this->model_->setPiece(linearIndex, this->nextPlayer_ == WhitePlayer ? model_->WhitePiece : model_->BlackPiece);
analysis->prisoners();
- switchPlayer();
+ switchPlayer();
}
+/* This should be calculated. It's fixed to the 13x13 size as such */
+
void AbstractBoardController::resetBoard()
{
qDebug("Reset");
@@ -32,6 +34,21 @@
this->model_->setPiece(n, model_->NoPiece);
n++;
}
+ // reset the totals
+ Q_EMIT blackTotalChanged();
+ Q_EMIT whiteTotalChanged();
+}
+
+QString AbstractBoardController::getBlacks()
+{
+ this->_blackTotal = this->model_->getBlackPieces();
+ return QString::number(this->_blackTotal);
+}
+
+QString AbstractBoardController::getWhites()
+{
+ this->_whiteTotal = this->model_->getWhitePieces();
+ return QString::number(this->_whiteTotal);
}
void AbstractBoardController::playMove(int line, int column)
@@ -45,6 +62,10 @@
player = nextPlayer_ == WhitePlayer ? "white" : "black";
+ // I'm still thinking about whether this doesn't belong in the model
+ Q_EMIT blackTotalChanged();
+ Q_EMIT whiteTotalChanged();
+
return player;
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailgo-0.5.0.tar.bz2/src/common/abstractboardcontroller.h
^
|
@@ -12,23 +12,31 @@
Q_OBJECT
Q_PROPERTY(QString nextPlayer READ nextPlayer NOTIFY nextPlayerChanged)
+ Q_PROPERTY(QString blackTotal READ getBlacks NOTIFY blackTotalChanged)
+ Q_PROPERTY(QString whiteTotal READ getWhites NOTIFY whiteTotalChanged)
public:
explicit AbstractBoardController(BoardModel * model, QObject *parent = 0);
~AbstractBoardController();
-
+ int blackCount;
+ int whiteCount;
Q_INVOKABLE void playMove(int linearIndex);
Q_INVOKABLE void playMove(int line, int column);
Q_INVOKABLE void resetBoard();
+ // abusing the controller, this could be 100% model.
+ Q_INVOKABLE QString getBlacks();
+ Q_INVOKABLE QString getWhites();
QString nextPlayer();
- player_t nextPlayerIndex();
+ player_t nextPlayerIndex();
void switchPlayer();
signals:
QString moveForbidden();
int playerPassed();
void nextPlayerChanged();
+ int blackTotalChanged();
+ int whiteTotalChanged();
public slots:
@@ -40,6 +48,8 @@
player_t nextPlayer_;
BoardModel * model_;
MoveAnalysis *analysis;
+ int _whiteTotal;
+ int _blackTotal;
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailgo-0.5.0.tar.bz2/src/common/boardmodel.cpp
^
|
@@ -6,7 +6,7 @@
{
this->nrows_ = rows;
this->ncolumns_ = columns;
- this->nslots = rows * columns;
+ this->nslots = rows * columns;
p_pieces = (piece_t *) calloc(this->nslots, sizeof(piece_t));
this->forbidden = -1;
@@ -47,6 +47,32 @@
emit this->dataChanged(topLeft, bottomRight);
}
+int BoardModel::getBlackPieces()
+{
+ int totalPieces = 0;
+ int n = 0;
+ while (n < 169 ) {
+ if (p_pieces[n] == BlackPiece) {
+ totalPieces++ ;
+ }
+ n++;
+ }
+ return totalPieces;
+}
+
+int BoardModel::getWhitePieces()
+{
+ int totalPieces = 0;
+ int n = 0;
+ while (n < 169 ) {
+ if (p_pieces[n] == WhitePiece) {
+ totalPieces++ ;
+ }
+ n++;
+ }
+ return totalPieces;
+}
+
void BoardModel::setPieceTmp(int linearIndex, piece_t state)
{
p_pieces[linearIndex] = state;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailgo-0.5.0.tar.bz2/src/common/boardmodel.h
^
|
@@ -46,6 +46,10 @@
void setPiece(int row, int column, PieceState state);
void setPiece(int linearIndex, PieceState state);
+
+ int getBlackPieces();
+ int getWhitePieces();
+
void setPieceTmp(int linearIndex, piece_t state);
void prisoner(int linearIndex);
@@ -59,6 +63,7 @@
public slots:
+
private:
int nrows_;
int ncolumns_;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailgo-0.5.0.tar.bz2/translations/harbour-sailgo-de.ts
^
|
@@ -9,7 +9,7 @@
<translation>SailGo</translation>
</message>
<message>
- <location filename="../qml/sailfishos/pages/About.qml" line="44"/>
+ <location filename="../qml/sailfishos/pages/About.qml" line="47"/>
<source>GPLv2 license.</source>
<translation>GPLv2 Lizens</translation>
</message>
@@ -25,19 +25,29 @@
<context>
<name>FirstPage</name>
<message>
- <location filename="../qml/sailfishos/pages/FirstPage.qml" line="46"/>
+ <location filename="../qml/sailfishos/pages/FirstPage.qml" line="47"/>
<source>About</source>
<translation>Über SailGo</translation>
</message>
<message>
- <location filename="../qml/sailfishos/pages/FirstPage.qml" line="52"/>
+ <location filename="../qml/sailfishos/pages/FirstPage.qml" line="53"/>
<source>New game</source>
<translation>Neues Spiel</translation>
</message>
<message>
- <location filename="../qml/sailfishos/pages/FirstPage.qml" line="65"/>
+ <location filename="../qml/sailfishos/pages/FirstPage.qml" line="66"/>
<source>SailGo</source>
<translation>SailGo</translation>
</message>
+ <message>
+ <location filename="../qml/sailfishos/pages/FirstPage.qml" line="101"/>
+ <source>Black</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/sailfishos/pages/FirstPage.qml" line="113"/>
+ <source>White</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
</TS>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailgo-0.5.0.tar.bz2/translations/harbour-sailgo.ts
^
|
@@ -33,5 +33,13 @@
<source>About</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>Black</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>White</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
</TS>
|