Browse Source

Realisation of dynamic game field

Ivan Arkhipov 6 years ago
parent
commit
9a0c3b8e74

+ 2 - 1
client.pro

@@ -115,7 +115,8 @@ SOURCES +=                                      \
     source/gui/buttoneventlistener.cpp \
     ui/hotseat_recruitment/iconhint.cpp \
     ui/dialog_form/dialogform.cpp \
-    ui/about_us/aboutus.cpp
+    ui/about_us/aboutus.cpp \
+    source/hotseatgame/gameproperties.cpp
 
 HEADERS +=                                      \
     include/abstractfactory.h                   \

+ 25 - 3
include/cell.h

@@ -1,4 +1,7 @@
 #pragma once
+#include <QObject>
+#include <QGraphicsItem>
+
 #include <queue>
 #include <vector>
 #include <memory>
@@ -21,7 +24,7 @@ class Unit;
  */
 class EffectsForCell;
 
-class Cell {
+class Cell : public QGraphicsItem {
 private:
 	/*
 	 * Соседние клетки к текущей
@@ -61,6 +64,24 @@ private:
 	 */
 	int distance_barrier_;
 	int distance_through_;
+
+    QPolygon polygon;
+
+public:
+    QRectF boundingRect() const override;
+
+    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
+
+    virtual bool contains(const QPointF &point) const override;
+
+    bool isHovered();
+
+    void setHovered(bool hovered);
+
+    void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
+
+    void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
+
 private:
     /*
      * Локальные методы и переменные
@@ -70,6 +91,7 @@ private:
 
     double coor_x_;
     double coor_y_;
+    bool hovered_;
 
 	void clearTable_();
 	void clearCell_();
@@ -85,7 +107,7 @@ private:
 	void updateUnMovealeCells_(std::queue<Cell *> &Q);
 
 public:
-    explicit Cell();
+    explicit Cell(QGraphicsItem* parent = nullptr);
 	/*
 	 * Геттеры и сеттеры соседних клеток и персонажа
 	 */
@@ -155,6 +177,6 @@ public:
 	 * Выполнится только с лучае, если эта следующая клетка существует
 	 * Gi1dor знает, что это такое
 	 */
-    std::vector<std::pair<double, double> > getPoints(double, double);
+    std::vector<std::pair<int, int> > getPoints(double, double);
     Cell* getRealShootTarget(Cell*);
 };

+ 7 - 5
include/hotseatgame/gamemanager.h

@@ -2,21 +2,22 @@
 #include <vector>
 #include <hotseatgame/unitsqueue.h>
 #include <playermanager.h>
+#include <QGraphicsView>
 
 class Cell;
 
 class GameManager : public QObject
 {
+    Q_OBJECT
+
 public:
-    void buildGameTable(int, int);
 
     static GameManager& getInstance() {
         static GameManager instance;
         return instance;
     }
 
-    void buildGameTable(int colSize, int rowSize, double radius,
-                        double start_x_coordinate, double start_y_coordinate);
+    void buildGameTable(double start_x_coordinate, double start_y_coordinate);
 
     UnitsQueue* getTurnQueue();
 
@@ -28,12 +29,13 @@ public:
 
     int getCurPlayerId();
 
+    std::vector<std::vector<Cell *> > getGameField();
+
 private:
     explicit GameManager(QObject *parent = nullptr);
 
     std::vector< std::vector< Cell* > > game_table_;
-    int col_table_size_, row_table_size_;
-    double cell_radius_, start_x_coordinate_, start_y_coordinate_;
+    double start_x_coordinate_, start_y_coordinate_;
 
     void generateTable();
 

+ 16 - 2
include/hotseatgame/gameproperties.h

@@ -39,13 +39,27 @@ public:
      * FIELD_ROWS_NUMBER - количество строк из шестиугольников на игровом поле
      */
 
-    static constexpr unsigned FIELD_ROWS_NUMBER = 8;
+    static unsigned FIELD_ROWS_NUMBER;
 
     /*
      * FIELD_COLUMNS_NUMBER - количество столбцов из шестиугольников на игровом поле
      */
 
-    static constexpr unsigned FIELD_COLUMNS_NUMBER = 15;
+    static unsigned FIELD_COLUMNS_NUMBER;
+
+    /*
+     * CELL_MIN_RADIUS - минимальное из расстояний от центра игровой клетки до её границ.
+     */
+
+    static double CELL_MIN_RADIUS;
+
+
+    /*
+     * CELL_MAX_RADIUS - максимальное из расстояний от центра игровой клетки до её границ.
+     */
+
+    static double CELL_MAX_RADIUS;
 };
 
+
 #endif // INCLUDEHOTSEATGAMEGAMEPROPERTIES_H

+ 67 - 7
source/cell.cpp

@@ -3,6 +3,7 @@
  */
 #include "cell.h"
 #include "units/unit.h"
+#include "hotseatgame/gameproperties.h"
 #include <string>
 #include <queue>
 #include <vector>
@@ -10,20 +11,26 @@
 #include <iostream>
 #include <cmath>
 
+#include <QPainter>
+#include <QPolygon>
+#include <QDebug>
+
 class EffectsForCell{
 public:
 	void OperateOnCell(Cell*){}
 };
 
 
-Cell::Cell()
+Cell::Cell(QGraphicsItem* parent) : QGraphicsItem(parent)
 {
     leftUp_ = left_ = leftDown_ = nullptr;
     rightUp_ = right_ = rightDown_ = nullptr;
     clearCell_();
     AddedToQuery_ = true;
     col_ = row_ = 0;
+    hovered_ = false;
     coor_x_ = coor_y_ = -1;
+    setAcceptHoverEvents(true);
 }
 
 Cell * Cell::getleftUp() {
@@ -193,6 +200,59 @@ void Cell::clearCell_() {
     setisRangeAttackAble(false);
 }
 
+QRectF Cell::boundingRect() const
+{
+    return QRectF(polygon.boundingRect());
+}
+
+void Cell::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+{
+    polygon.clear();
+    auto points = getPoints(GameProperties::CELL_MAX_RADIUS, 0);
+
+    for (auto point : points) {
+        polygon << QPoint(point.first, point.second);
+    }
+    polygon << QPoint(points[0].first, points[0].second);
+
+    QPen pen = QPen(Qt::green, 2);
+    painter->setPen(pen);
+    painter->setBrush(Qt::green); // We set the brush, which will render the object
+    painter->drawPolyline(polygon);  // Draw a triangle on a polygonal model
+
+    if (hovered_) {
+        painter->setOpacity(0.4);
+        painter->drawPolygon(polygon);
+    }
+}
+
+bool Cell::contains(const QPointF &point) const
+{
+    return polygon.contains(point.toPoint());
+}
+
+bool Cell::isHovered()
+{
+    return hovered_;
+}
+
+void Cell::setHovered(bool hovered)
+{
+    hovered_ = hovered;
+}
+
+void Cell::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
+{
+    hovered_ = true;
+    update();
+}
+
+void Cell::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
+{
+    hovered_ = false;
+    update();
+}
+
 void Cell::clearTable_() {
 	std::queue<Cell*> q;
 	q.push(this);
@@ -351,14 +411,14 @@ Cell* Cell::getRealShootTarget(Cell* next){
 	}
 }
 
-std::vector<std::pair<double, double> > Cell::getPoints(double radius, double start_angle) {
-    const double delta_radians = acos(-1) / 180.0;
-    std::vector<std::pair<double, double> > res;
+std::vector<std::pair<int, int> > Cell::getPoints(double radius, double start_angle) {
+    const double delta_radians = M_PI / 180.0;
+    std::vector<std::pair<int, int> > res;
     std::vector<double> angles = {0, 60, 120, 180, 240, 300};
-    for(size_t i = 0;i < angles.size();++i){
+    for(size_t i = 0; i < angles.size(); ++i){
         angles[i] += start_angle;
-        res.push_back({coor_x_ + radius * std::cos(angles[i] * delta_radians),
-                       coor_y_ + radius * std::sin(angles[i] * delta_radians)});
+        res.push_back({std::round(radius * std::sin(angles[i] * delta_radians)),
+                       std::round(radius * std::cos(angles[i] * delta_radians))});
     }
     return res;
 }

+ 66 - 34
source/hotseatgame/gamemanager.cpp

@@ -3,51 +3,50 @@
 */
 #include "include/hotseatgame/gamemanager.h"
 #include "cell.h"
+#include "hotseatgame/gameproperties.h"
 #include <iostream>
+#include <cmath>
 
 GameManager::GameManager(QObject *parent) : QObject(parent) {
 
 }
 
-void GameManager::buildGameTable(int colSize, int rowSize, double radius,
-                                 double start_x_coordinate, double start_y_coordinate) {
-    col_table_size_ = colSize;
-    row_table_size_ = rowSize;
-    cell_radius_ = radius;
+void GameManager::buildGameTable(double start_x_coordinate, double start_y_coordinate) {
     start_x_coordinate_ = start_x_coordinate;
     start_y_coordinate_ = start_y_coordinate;
     generateTable();
 }
 
 void GameManager::generateTable() {
-    game_table_.assign(col_table_size_, std::vector< Cell* >(row_table_size_, nullptr));
-    for (int col = 0; col < col_table_size_; ++col) {
-        for (int row = 0; row < row_table_size_; ++row) {
-            game_table_[col][row] = new Cell();
+    game_table_.assign(GameProperties::FIELD_COLUMNS_NUMBER, std::vector< Cell* >(GameProperties::FIELD_ROWS_NUMBER, nullptr));
+    for (unsigned row = 0; row < GameProperties::FIELD_ROWS_NUMBER; ++row) {
+        for (unsigned col = 0; col < GameProperties::FIELD_COLUMNS_NUMBER; ++col) {
+            game_table_[col][row] = new Cell(nullptr);
         }
     }
-    int isEven = 1;
-    for (int col = 0; col < col_table_size_; ++col) {
+
+    unsigned isEven = 1;
+    for (unsigned row = 0; row < GameProperties::FIELD_ROWS_NUMBER; ++row) {
         isEven ^= 1;
-        for (int row = 0; row < row_table_size_; ++row) {
-            if (col != 0 && row != 0 -isEven) {
-                game_table_[col][row]->setleftUp(game_table_[col - 1][row - 1 +isEven]);
+        for (unsigned col = 0; col < GameProperties::FIELD_COLUMNS_NUMBER; ++col) {
+            if (row != 0 && col != 0 - isEven) {
+                game_table_[col][row]->setleftUp(game_table_[col - 1 +isEven][row - 1]);
             }
-            if (row != 0) {
-                game_table_[col][row]->setleft(game_table_[col][row - 1]);
+            if (col != 0) {
+                game_table_[col][row]->setleft(game_table_[col - 1][row]);
             }
-            if (col != col_table_size_ - 1 && row != 0 -isEven) {
-                game_table_[col][row]->setleftDown(game_table_[col + 1][row - 1 +isEven]);
+            if (row != GameProperties::FIELD_ROWS_NUMBER - 1 && col != 0 -isEven) {
+                game_table_[col][row]->setleftDown(game_table_[col - 1 +isEven][row + 1]);
             }
 
-            if (col != 0 && row != row_table_size_ -isEven) {
-                game_table_[col][row]->setrightUp(game_table_[col - 1][row +isEven]);
+            if (row != 0 && col != GameProperties::FIELD_COLUMNS_NUMBER -isEven) {
+                game_table_[col][row]->setrightUp(game_table_[col +isEven][row - 1]);
             }
-            if (row != row_table_size_ - 1) {
-                game_table_[col][row]->setright(game_table_[col][row + 1]);
+            if (col != GameProperties::FIELD_COLUMNS_NUMBER - 1) {
+                game_table_[col][row]->setright(game_table_[col + 1][row]);
             }
-            if (col != col_table_size_ - 1 && row != row_table_size_ -isEven) {
-                game_table_[col][row]->setrightDown(game_table_[col + 1][row +isEven]);
+            if (row != GameProperties::FIELD_ROWS_NUMBER - 1 && col != GameProperties::FIELD_COLUMNS_NUMBER -isEven) {
+                game_table_[col][row]->setrightDown(game_table_[col +isEven][row + 1]);
             }
         }
     }
@@ -55,26 +54,54 @@ void GameManager::generateTable() {
     game_table_[0][0]->setXCoordinate(start_x_coordinate_);
     game_table_[0][0]->setYCoordinate(start_y_coordinate_);
 
-    for (int col = 0; col < col_table_size_; ++col) {
-        for (int row = 0; row < row_table_size_; ++row) {
+    for (unsigned row = 0; row < GameProperties::FIELD_ROWS_NUMBER; ++row) {
+        for (unsigned col = 0; col < GameProperties::FIELD_COLUMNS_NUMBER; ++col) {
             auto cell = game_table_[col][row];
 
-            double center_x = cell->getXCoordinate();
-            double center_y = cell->getYCoordinate();
+            auto verticles = cell->getPoints(GameProperties::CELL_MIN_RADIUS * 2, 30.0);
+
+            if (cell->getrightUp()) {
+                cell->getrightUp()->setXCoordinate(cell->getXCoordinate() + verticles[0].first );
+                cell->getrightUp()->setYCoordinate(cell->getYCoordinate() + verticles[0].second);
+            }
+
+            if (cell->getright()) {
+                cell->getright()->setXCoordinate(cell->getXCoordinate() + verticles[1].first );
+                cell->getright()->setYCoordinate(cell->getYCoordinate() + verticles[1].second);
+            }
+
+            if (cell->getrightDown()) {
+                cell->getrightDown()->setXCoordinate(cell->getXCoordinate() + verticles[2].first );
+                cell->getrightDown()->setYCoordinate(cell->getYCoordinate() + verticles[2].second);
+            }
 
-            if (center_x == -1 && center_y == -1)
-                continue;
+            if (cell->getleftDown()) {
+                cell->getleftDown()->setXCoordinate(cell->getXCoordinate() + verticles[3].first );
+                cell->getleftDown()->setYCoordinate(cell->getYCoordinate() + verticles[3].second);
+            }
 
-            auto verticles = cell->getPoints(cell_radius_, 0.0);
+            if (cell->getleft()) {
+                cell->getleft()->setXCoordinate(cell->getXCoordinate() + verticles[4].first );
+                cell->getleft()->setYCoordinate(cell->getYCoordinate() + verticles[4].second);
+            }
 
-            if (cell->getleft() && cell->getleft()->getXCoordinate() == -1 && cell->getleft()->getYCoordinate() == -1) {
-                cell->getleft()->setXCoordinate(center_x + 2 * (verticles[0].first - center_x));
-                cell->getleft()->setYCoordinate(center_y + 2 * (verticles[0].second - center_y));
+            if (cell->getleftUp()) {
+                cell->getleftUp()->setXCoordinate(cell->getXCoordinate() + verticles[5].first );
+                cell->getleftUp()->setYCoordinate(cell->getYCoordinate() + verticles[5].second);
             }
         }
     }
+
+    for (unsigned row = 0; row < GameProperties::FIELD_ROWS_NUMBER; ++row) {
+        for (unsigned col = 0; col < GameProperties::FIELD_COLUMNS_NUMBER; ++col) {
+            auto cell = game_table_[col][row];
+            std::cout << "(" << cell->getXCoordinate() << "," << cell->getYCoordinate() << ") ";
+        }
+        std::cout << std::endl;
+    }
 }
 
+
 UnitsQueue* GameManager::getTurnQueue() {
     return &turn_queue_;
 }
@@ -91,6 +118,11 @@ int GameManager::getCurPlayerId() {
     return cur_player_id_;
 }
 
+std::vector<std::vector<Cell *> > GameManager::getGameField()
+{
+    return game_table_;
+}
+
 Player* GameManager::getCurrentPlayer() {
     return player_manager_->getPlayer(cur_player_id_);
 }

+ 6 - 0
source/hotseatgame/gameproperties.cpp

@@ -0,0 +1,6 @@
+#include "hotseatgame/gameproperties.h"
+
+unsigned GameProperties::FIELD_ROWS_NUMBER = 8;
+unsigned GameProperties::FIELD_COLUMNS_NUMBER = 15;
+double GameProperties::CELL_MIN_RADIUS = 15;
+double GameProperties::CELL_MAX_RADIUS = 15;

+ 103 - 0
ui/hotseat_game/hotseatgame.cpp

@@ -5,8 +5,12 @@
 #include "cell.h"
 #include "hotseatgame/gamemanager.h"
 
+#include <cmath>
+
 #include <QDebug>
 #include <QGraphicsScene>
+#include <QEvent>
+#include <QResizeEvent>
 
 HotSeatGame::HotSeatGame(QWidget *parent) :
     Scene(parent),
@@ -14,10 +18,58 @@ HotSeatGame::HotSeatGame(QWidget *parent) :
 {
     qDebug() << "Initialising game";
     ui->setupUi(this);
+    game_scene_ = new QGraphicsScene(ui->game_content);
+    ui->game_content->setScene(game_scene_);
+    setMouseTracking(true);
+    ui->game_content->setMouseTracking(true);
+    game_scene_watcher_ = new DrawSceneEventListener(this);
+    ui->game_content->installEventFilter(game_scene_watcher_);
 }
 
 void HotSeatGame::init() {
+    GameProperties::FIELD_ROWS_NUMBER = 6;
+    GameProperties::FIELD_COLUMNS_NUMBER = 14;
+    int left_right_margin = 0;
+    int up_down_margin = 0;
+
+    int widget_width = ui->game_content->width();
+    int widget_height = ui->game_content->height();
+
+    qDebug() << widget_width << " " << widget_height;
+
+    int predictable_min_radius = (widget_width - left_right_margin * 2) / ((GameProperties::FIELD_COLUMNS_NUMBER + 1) * 2);
+    int predictable_max_radius = (widget_height - up_down_margin * 2) / ((GameProperties::FIELD_ROWS_NUMBER + 1) * 2);
+
+    qDebug() << predictable_min_radius << " " << predictable_max_radius;
+
+    if (abs(predictable_max_radius * sin(60.0 * M_PI / 180.0)) > abs(predictable_min_radius)) {
+        predictable_max_radius = abs(predictable_min_radius /  sin(60.0 * M_PI / 180.0));
+    } else {
+        predictable_min_radius = abs(predictable_max_radius * sin(60.0 * M_PI / 180.0));
+    }
 
+    qDebug() << predictable_min_radius << " " << predictable_max_radius;
+
+    GameProperties::CELL_MIN_RADIUS = predictable_min_radius;
+    GameProperties::CELL_MAX_RADIUS = predictable_max_radius;
+
+    left_right_margin = (widget_width - predictable_min_radius * GameProperties::FIELD_COLUMNS_NUMBER * 2) / 2;
+    up_down_margin = (widget_height - predictable_max_radius * GameProperties::FIELD_ROWS_NUMBER * 2) / 2;
+    qDebug() << left_right_margin << " " << up_down_margin;
+    qDebug() << predictable_min_radius * GameProperties::FIELD_COLUMNS_NUMBER * 2 << " " << predictable_max_radius * GameProperties::FIELD_ROWS_NUMBER * 2;
+    GameManager::getInstance().buildGameTable(left_right_margin + GameProperties::CELL_MIN_RADIUS, -up_down_margin - GameProperties::CELL_MAX_RADIUS);
+    drawField();
+}
+
+void HotSeatGame::deinit()
+{
+    auto field = GameManager::getInstance().getGameField();
+    for (int i = 0; i < field.size(); i++) {
+        for (int j = 0; j < field[i].size(); j++){
+            field[i][j]->setVisible(false);
+            game_scene_->removeItem(field[i][j]);
+        }
+    }
 }
 
 
@@ -33,3 +85,54 @@ void HotSeatGame::on_surrender_button__clicked()
     //GuiSceneManager::getInstance().changeScene("hotseatgame_results");
     GuiSceneManager::getInstance().changeScene("main_menu");
 }
+
+void HotSeatGame::drawField()
+{
+    auto field = GameManager::getInstance().getGameField();
+    game_scene_->addRect(0, 0, 0.1, 0.1);
+    for (unsigned row = 0; row < GameProperties::FIELD_ROWS_NUMBER; ++row) {
+        for (unsigned col = 0; col < GameProperties::FIELD_COLUMNS_NUMBER; ++col) {
+            auto cell = field[col][row];
+
+            double center_x = cell->getXCoordinate();
+            double center_y = cell->getYCoordinate();
+
+            qDebug() << center_x << " " << center_y;
+            game_scene_->addItem(cell);
+            cell->setPos(cell->getXCoordinate(), cell->getYCoordinate());
+            cell->setVisible(true);
+        }
+    }
+}
+
+DrawSceneEventListener::DrawSceneEventListener(HotSeatGame *scene, QObject *parent) : QObject(parent) {
+    scene_ = scene;
+}
+
+bool DrawSceneEventListener::eventFilter(QObject *watched, QEvent *event)
+{
+    if (event->type() == QEvent::Resize) {
+        scene_->deinit();
+        scene_->init();
+    }
+
+    if (event->type() == QEvent::MouseMove || event->type() == QEvent::MouseButtonPress ) {
+        qDebug() << "ha-ha!!";
+
+        QMouseEvent* evt = dynamic_cast<QMouseEvent*>(event);
+        auto cells = GameManager::getInstance().getGameField();
+        qDebug() << evt->globalPos();
+        for (int i = 0; i < cells.size(); i++) {
+            for (int j = 0; j < cells[i].size(); j++) {
+                if (cells[i][j]->contains(evt->localPos())) {
+                    qDebug() << "He-he!!!";
+                    cells[i][j]->setHovered(true);
+                } else {
+                    cells[i][j]->setHovered(false);
+                }
+                cells[i][j]->show();
+            }
+        }
+    }
+    return false;
+}

+ 21 - 2
ui/hotseat_game/hotseatgame.h

@@ -11,6 +11,22 @@ namespace Ui {
 class HotSeatGame;
 }
 
+class HotSeatGame;
+
+class DrawSceneEventListener : public QObject
+{
+    Q_OBJECT
+public:
+    DrawSceneEventListener(HotSeatGame* scene, QObject *parent = nullptr);
+    virtual bool eventFilter(QObject * watched, QEvent * event) Q_DECL_OVERRIDE;
+signals:
+
+public slots:
+private:
+    HotSeatGame* scene_;
+};
+
+
 class HotSeatGame : public Scene
 {
     Q_OBJECT
@@ -20,16 +36,19 @@ public:
     ~HotSeatGame();
 
     void init() override;
-
+    void deinit() override;
 
 private slots:
-
     void on_surrender_button__clicked();
 
+    void drawField();
+
 private:
     void paintField();
 
+    QGraphicsScene *game_scene_;
     Ui::HotSeatGame *ui;
+    DrawSceneEventListener *game_scene_watcher_;
 };
 
 #endif // HOTSEATGAME_H

+ 47 - 39
ui/hotseat_game/hotseatgame.ui

@@ -56,45 +56,6 @@
       <string notr="true">border-image: url(:/assets/hotseat_game/battle_bg/bg(1).png);</string>
      </property>
      <layout class="QGridLayout" name="gridLayout_2">
-      <item row="0" column="0">
-       <spacer name="verticalSpacer_5">
-        <property name="orientation">
-         <enum>Qt::Vertical</enum>
-        </property>
-        <property name="sizeHint" stdset="0">
-         <size>
-          <width>20</width>
-          <height>40</height>
-         </size>
-        </property>
-       </spacer>
-      </item>
-      <item row="0" column="1" rowspan="3">
-       <widget class="QGraphicsView" name="game_content">
-        <property name="styleSheet">
-         <string notr="true">background: transparent;
-border-image: none;</string>
-        </property>
-        <property name="backgroundBrush">
-         <brush brushstyle="NoBrush">
-          <color alpha="0">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </property>
-        <property name="foregroundBrush">
-         <brush brushstyle="NoBrush">
-          <color alpha="0">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </property>
-       </widget>
-      </item>
       <item row="1" column="0">
        <widget class="QWidget" name="unit_chars_widget_" native="true">
         <property name="sizePolicy">
@@ -1242,6 +1203,53 @@ background: none;</string>
         </property>
        </spacer>
       </item>
+      <item row="0" column="0">
+       <spacer name="verticalSpacer_5">
+        <property name="orientation">
+         <enum>Qt::Vertical</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>20</width>
+          <height>40</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item row="0" column="1" rowspan="3">
+       <widget class="QGraphicsView" name="game_content">
+        <property name="mouseTracking">
+         <bool>true</bool>
+        </property>
+        <property name="styleSheet">
+         <string notr="true">background:transparent; border-image: none;</string>
+        </property>
+        <property name="frameShape">
+         <enum>QFrame::NoFrame</enum>
+        </property>
+        <property name="frameShadow">
+         <enum>QFrame::Plain</enum>
+        </property>
+        <property name="lineWidth">
+         <number>0</number>
+        </property>
+        <property name="interactive">
+         <bool>true</bool>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
+        </property>
+        <property name="dragMode">
+         <enum>QGraphicsView::NoDrag</enum>
+        </property>
+        <property name="transformationAnchor">
+         <enum>QGraphicsView::NoAnchor</enum>
+        </property>
+        <property name="viewportUpdateMode">
+         <enum>QGraphicsView::SmartViewportUpdate</enum>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>