kigo
gamescene.cpp
Go to the documentation of this file.
63 m_mouseRect = m_gridRect.adjusted(-m_cellSize / 2, - m_cellSize / 2, m_cellSize / 2, m_cellSize / 2);
65 m_stonePixmapSize = QSize(static_cast<int>(m_cellSize * 1.4), static_cast<int>(m_cellSize * 1.4));
73 m_placementMarkerPixmapSize = QSize(static_cast<int>(m_cellSize / 4), static_cast<int>(m_cellSize / 4));
74 m_placementMarkerItem = addPixmap(ThemeRenderer::self()->renderElement(ThemeRenderer::PlacementMarker, m_placementMarkerPixmapSize));
129 item = addPixmap(ThemeRenderer::self()->renderElement(ThemeRenderer::BlackStone, m_stonePixmapSize));
137 item = addPixmap(ThemeRenderer::self()->renderElement(ThemeRenderer::WhiteStone, m_stonePixmapSize));
188 stonePixmap = ThemeRenderer::self()->renderElement(ThemeRenderer::WhiteStoneTransparent, m_stonePixmapSize);
190 stonePixmap = ThemeRenderer::self()->renderElement(ThemeRenderer::BlackStoneTransparent, m_stonePixmapSize);
229 stonePixmap = ThemeRenderer::self()->renderElement(ThemeRenderer::WhiteTerritory, QSize(m_cellSize, m_cellSize));
239 stonePixmap = ThemeRenderer::self()->renderElement(ThemeRenderer::BlackTerritory, QSize(m_cellSize, m_cellSize));
274 int x = m_mouseRect.x() + row * m_cellSize + m_cellSize/2 - m_placementMarkerPixmapSize.width()/2;
275 int y = m_mouseRect.y() + col * m_cellSize + m_cellSize/2 - m_placementMarkerPixmapSize.height()/2;
285 map = ThemeRenderer::self()->renderElement(ThemeRenderer::WhiteStoneTransparent, m_stonePixmapSize);
287 map = ThemeRenderer::self()->renderElement(ThemeRenderer::BlackStoneTransparent, m_stonePixmapSize);
306 // Convert to Go board coordinates and try to play the move. GnuGo coordinates don't use the 'I'
void clear()
int ascent() const
QList< Stone > finalStates(FinalState state)
Report fields with a specified final status in a finished game.
Definition: game.cpp:669
int width() const
QGraphicsItem * itemAt(const QPointF &position) const
void setRenderHint(RenderHint hint, bool on)
qreal x() const
qreal y() const
const QFont & font() const
void setSceneRect(const QRectF &rect)
int descent() const
qreal top() const
QPointF scenePos() const
void cursorPixmapChanged(const QPixmap &)
void drawLine(const QLineF &line)
qreal height() const
qreal left() const
QGraphicsPixmapItem * addPixmap(const QPixmap &pixmap)
qreal bottom() const
void setFont(const QFont &font)
QString number(int n, int base)
void append(const T &value)
void removeItem(QGraphicsItem *item)
void setPen(const QColor &color)
void drawEllipse(const QRectF &rectangle)
QList< Stone > bestMoves(const Player &player)
Generate a list of the best moves for a player with weights.
Definition: game.cpp:593
void setPos(const QPointF &pos)
bool isEmpty() const
void setBrush(const QBrush &brush)
void drawText(const QPointF &position, const QString &text)
QList< Stone > stones(const Player &player)
Returns a list of all stones of that player on the board.
Definition: game.cpp:531
QFuture< void > map(Sequence &sequence, MapFunction function)
qreal right() const
int width(const QString &text, int len) const
void setPointSizeF(qreal pointSize)
Definition: themerenderer.h:61
qreal width() const
QList< Move > moves(const Player &player)
Returns a list of all moves by that player.
Definition: game.cpp:558
static ThemeRenderer * self()
Only one ThemeRenderer is needed per application, this method returns the singleton self...
Definition: themerenderer.h:78
QFontMetrics fontMetrics() const
int height() const
void setPixmap(const QPixmap &pixmap)
void invalidate(qreal x, qreal y, qreal w, qreal h, QFlags< QGraphicsScene::SceneLayer > layers)
QPixmap pixmap() const
void setVisible(bool visible)
QRectF adjusted(qreal dx1, qreal dy1, qreal dx2, qreal dy2) const
bool contains(const QPointF &point) const
void setRect(qreal x, qreal y, qreal width, qreal height)
The Game class implements the Go game and acts as a wrapper around a remote Go Game game implementing...
Definition: game.h:60
Definition: preferences.h:9
void renderElement(Element element, QPainter *painter, const QRectF &rect) const
Renders a specific element of the current SVG theme.
Definition: themerenderer.cpp:86
void addItem(QGraphicsItem *item)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QRect rect() const
void setZValue(qreal z)
void showMessage(const QString &message, int msecs=2000)
Definition: gamescene.cpp:102
qreal width() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:29 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:29 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.