From ffd5e11aa005363486a0c4ee9101a45bce2b061a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A3=D1=88=D0=BA=D0=BE=D0=B2=D0=B0=20=D0=94=D0=B8=D0=B0?=
 =?UTF-8?q?=D0=BD=D0=B0=20=D0=9F=D0=B5=D1=82=D1=80=D0=BE=D0=B2=D0=BD=D0=B0?=
 <dpushkova@edu.hse.ru>
Date: Sun, 2 Mar 2025 14:11:57 +0300
Subject: [PATCH 1/6] started to create hard level

---
 source/application/App/Application.cpp        |  3 +-
 source/application/App/Application.h          |  2 +-
 .../application/BobBuilder/GameBuilders.cpp   | 50 +++++++++++++++++--
 .../Drawable/DrawMenu/Menu/Menu.cpp           |  2 +-
 .../application/Drawable/Entity/IEntity.cpp   |  5 +-
 source/application/State/GameState.cpp        | 25 +++++-----
 6 files changed, 64 insertions(+), 23 deletions(-)

diff --git a/source/application/App/Application.cpp b/source/application/App/Application.cpp
index 6bac2e1..0c2126a 100644
--- a/source/application/App/Application.cpp
+++ b/source/application/App/Application.cpp
@@ -28,6 +28,5 @@ void Application::set_next_state(std::unique_ptr<IState>&& ptr_state) {
 
 void Application::apply_deffer_state_change() noexcept {
     if (m_ptr_state_next)
-        std::swap(m_ptr_state_current, m_ptr_state_next);
-    m_ptr_state_next.reset();
+        m_ptr_state_current = std::exchange(m_ptr_state_next, nullptr);
 }
\ No newline at end of file
diff --git a/source/application/App/Application.h b/source/application/App/Application.h
index d8c0124..a08c9a4 100644
--- a/source/application/App/Application.h
+++ b/source/application/App/Application.h
@@ -10,7 +10,7 @@ class Application : public IStateManager {
 public:
     Application();
     int run();
-    ~Application() = default;
+    ~Application() override = default;
 
 private:
     void set_next_state(std::unique_ptr<IState>&& ptr_state) override;
diff --git a/source/application/BobBuilder/GameBuilders.cpp b/source/application/BobBuilder/GameBuilders.cpp
index 653f125..c77f9bf 100644
--- a/source/application/BobBuilder/GameBuilders.cpp
+++ b/source/application/BobBuilder/GameBuilders.cpp
@@ -1,7 +1,5 @@
 #include "GameBuilders.h"
 
-#include <random>
-
 CommonBuilder::CommonBuilder(float width, float height, float room_size) :
             m_width(width), m_height(height), m_room_size(room_size){
 }
@@ -12,11 +10,22 @@ void CommonBuilder::create_context(float dynamic_objects_ratio) {
         for (auto& room : row)
             if (room != nullptr)
                 empty_rooms_buffer.emplace_back(room);
+
     float id = std::rand() % empty_rooms_buffer.size();
+    //в рандомное место располагаем пакмана
     m_context.pacman.set_location(empty_rooms_buffer[id]);
     auto it = std::next(empty_rooms_buffer.begin(), id);
     empty_rooms_buffer.erase(it);
-    //@todo располагать врагов
+
+    //располагаем врагов
+    size_t rooms_row = static_cast<size_t>(m_width / m_room_size);
+    size_t rooms_col = static_cast<size_t>(m_height / m_room_size);
+    for (size_t i = 0; i < rooms_row * rooms_col * dynamic_objects_ratio; i++) {
+        id = std::rand() % empty_rooms_buffer.size();
+        auto enemy = std::make_unique<Enemy>();
+        enemy->set_location(empty_rooms_buffer.at(i));
+        m_context.dynamic_objects.emplace_back(std::move(enemy));
+    }
 
     //располагаем еду
     for (auto it : empty_rooms_buffer) {
@@ -96,9 +105,42 @@ void SimpleBuilder::set_rooms_sides() {
 }
 
 void ComplexBuilder::create_rooms() {
+    size_t room_quantity_row = (m_height / m_room_size);
+    size_t room_quantity_col = (m_width / m_room_size);
 
+    int room_size = static_cast<int>(m_room_size);
+    auto starting_point = sf::Vector2f{(m_width - m_room_size*room_quantity_col)/2 + m_room_size/2, (m_height - m_room_size*room_quantity_row)/2 + + m_room_size/2};
+
+    for (int row = 0; row < room_quantity_row * room_size; row += room_size) {
+        std::vector<Room*> vector_row;
+        for (int col = 0; col < room_quantity_col * room_size; col += room_size) {
+            auto room = new Room(m_room_size);
+            room->set_position(sf::Vector2f {(col + starting_point.x), (row + starting_point.y)});
+            vector_row.emplace_back(std::move(room));
+        }
+        m_rooms.emplace_back(std::move(vector_row));
+    }
 }
 
 void ComplexBuilder::set_rooms_sides() {
-
+    for (size_t row = 0; row < m_rooms.size(); ++row)
+        for (size_t col = 0; col < m_rooms[0].size(); ++col) {
+            m_rooms[row][col]->set_side(Room::UP, std::make_shared<Wall>(*m_rooms[row][col]));
+            m_rooms[row][col]->set_side(Room::DOWN, std::make_shared<Wall>(*m_rooms[row][col]));
+            m_rooms[row][col]->set_side(Room::LEFT, std::make_shared<Wall>(*m_rooms[row][col]));
+            m_rooms[row][col]->set_side(Room::RIGHT, std::make_shared<Wall>(*m_rooms[row][col]));
+        }
+    for (size_t row = 1; row < m_rooms.size(); ++row)
+        for (size_t col = 1; col < m_rooms[0].size(); ++col) {
+            if (col % 2 == 1) {
+                auto pass = std::make_shared<Pass>(*m_rooms[row][col], *m_rooms[row - 1][col]);
+                m_rooms[row][col]->set_side(Room::UP, pass);
+                m_rooms[row - 1][col]->set_side(Room::DOWN, pass);
+            }
+            if (row % 2 == 1) {
+                auto pass = std::make_shared<Pass>(*m_rooms[row][col], *m_rooms[row][col-1]);
+                m_rooms[row][col]->set_side(Room::LEFT, pass);
+                m_rooms[row][col-1]->set_side(Room::RIGHT, pass);
+            }
+        }
 }
\ No newline at end of file
diff --git a/source/application/Drawable/DrawMenu/Menu/Menu.cpp b/source/application/Drawable/DrawMenu/Menu/Menu.cpp
index 833f2c6..6ffe566 100644
--- a/source/application/Drawable/DrawMenu/Menu/Menu.cpp
+++ b/source/application/Drawable/DrawMenu/Menu/Menu.cpp
@@ -21,7 +21,7 @@ Menu::Menu(IStateManager& state_manager) {
             config::MEDIUM_GAME_TITLE,
             config::MEDIUM_GAME_ENEMY_RATIO);
     auto hard_director = std::make_unique<GameBuilderDirector>(
-            std::make_unique<SimpleBuilder>(
+            std::make_unique<ComplexBuilder>(
                     config::GAME_VIDEO_MODE.width, config::GAME_VIDEO_MODE.height,
                     config::ROOM_SIZE),
             config::GAME_VIDEO_MODE,
diff --git a/source/application/Drawable/Entity/IEntity.cpp b/source/application/Drawable/Entity/IEntity.cpp
index ab32bca..5b920fa 100644
--- a/source/application/Drawable/Entity/IEntity.cpp
+++ b/source/application/Drawable/Entity/IEntity.cpp
@@ -31,12 +31,11 @@ std::unique_ptr<IGameEvent> Food::accept(IVisitor* ptr_visitor) {
 
 void Food::draw_into(sf::RenderWindow& window) {
     m_shape.setPosition(m_ptr_room->get_position());
-    //из класса Room: sf::Vector2f get_position() { return m_rectangle.getPosition(); }
     window.draw(m_shape);
 }
 
 Enemy::Enemy() {
-    m_shape = sf::CircleShape(config::GAME_ENEMY_SIZE);
+    m_shape = sf::CircleShape(config::GAME_ENEMY_SIZE/2);
     m_shape.setFillColor(config::GAME_ENEMY_COLOR);
     m_shape.setOrigin({config::GAME_ENEMY_SIZE / 2, config::GAME_ENEMY_SIZE / 2});
 }
@@ -49,7 +48,7 @@ void Enemy::prepare_for_drawing() {
     m_shape.setPosition(m_ptr_room->get_position());
 }
 
-void Enemy::draw_into(sf::RenderWindow &window) {
+void Enemy::draw_into(sf::RenderWindow& window) {
     prepare_for_drawing();
     window.draw(m_shape);
 }
diff --git a/source/application/State/GameState.cpp b/source/application/State/GameState.cpp
index bab1573..60f409b 100644
--- a/source/application/State/GameState.cpp
+++ b/source/application/State/GameState.cpp
@@ -23,15 +23,19 @@ void GameState::event_handling() {
 void GameState::process_key_pressed(sf::Keyboard::Key code) {
     switch (code) {
         case sf::Keyboard::W:
-            m_context_manager.get_current_context().pacman.move(Room::UP);
+            m_context_manager.save_current_context(); //сохраняем состояние
+            m_context_manager.get_current_context().pacman.move(Room::UP); //выполнили действие
             break;
         case sf::Keyboard::S:
+            m_context_manager.save_current_context();
             m_context_manager.get_current_context().pacman.move(Room::DOWN);
             break;
         case sf::Keyboard::A:
+            m_context_manager.save_current_context();
             m_context_manager.get_current_context().pacman.move(Room::LEFT);
             break;
         case sf::Keyboard::D:
+            m_context_manager.save_current_context();
             m_context_manager.get_current_context().pacman.move(Room::RIGHT);
             break;
     }
@@ -41,22 +45,18 @@ void GameState::update() {
     std::vector<std::unique_ptr<IGameEvent>> game_events;
     if (m_context_manager.get_current_context().state != GameContext::INGAME) return;
     GameContext& context = m_context_manager.get_current_context();
-    for (auto& entity_ptr : context.dynamic_objects) {
-        entity_ptr->action();
+    for (auto& ptr_entity : context.dynamic_objects) {
+        ptr_entity->action();
         IVisitor* ptr_visitor = &(context.pacman);
-        game_events.emplace_back(entity_ptr->accept(ptr_visitor));
+        auto ptr_event = ptr_entity->accept(ptr_visitor);
+        if (ptr_event)  game_events.emplace_back(std::move(ptr_event));
     }
     for (auto& static_ptr : context.static_objects) {
         IVisitor* ptr_visitor = &(context.pacman);
         auto ptr_event = static_ptr->accept(ptr_visitor);
-        if (ptr_event)
-            game_events.emplace_back(std::move(ptr_event));
-    }
-    for (auto it = context.dynamic_objects.begin(); it != context.dynamic_objects.end(); ++it) {
-        if (context.pacman.get_location() == (*it)->get_location()) {
-            game_events.emplace_back(std::move(std::make_unique<LostGame>()));
-        }
+        if (ptr_event)  game_events.emplace_back(std::move(ptr_event));
     }
+
     for (int i = 0; i < game_events.size(); i++) {
         game_events[i]->handle(&m_context_manager.get_current_context());
     }
@@ -92,7 +92,8 @@ void GameState::render() {
 
 bool GameState::do_step() {
     event_handling();
-    update();
+    if (m_context_manager.get_current_context().state == GameContext::INGAME)
+        update();
     render();
     return true;
 }
-- 
GitLab


From 9cda5b778fd50f0dc2abf31bbd92dd52023b733f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A3=D1=88=D0=BA=D0=BE=D0=B2=D0=B0=20=D0=94=D0=B8=D0=B0?=
 =?UTF-8?q?=D0=BD=D0=B0=20=D0=9F=D0=B5=D1=82=D1=80=D0=BE=D0=B2=D0=BD=D0=B0?=
 <dpushkova@edu.hse.ru>
Date: Sun, 2 Mar 2025 19:32:17 +0300
Subject: [PATCH 2/6] started hard level

---
 .../application/BobBuilder/GameBuilders.cpp   | 80 ++++++++++++++-----
 1 file changed, 61 insertions(+), 19 deletions(-)

diff --git a/source/application/BobBuilder/GameBuilders.cpp b/source/application/BobBuilder/GameBuilders.cpp
index c77f9bf..5e6f8b6 100644
--- a/source/application/BobBuilder/GameBuilders.cpp
+++ b/source/application/BobBuilder/GameBuilders.cpp
@@ -1,7 +1,7 @@
 #include "GameBuilders.h"
 
 CommonBuilder::CommonBuilder(float width, float height, float room_size) :
-            m_width(width), m_height(height), m_room_size(room_size){
+        m_width(width), m_height(height), m_room_size(room_size){
 }
 
 void CommonBuilder::create_context(float dynamic_objects_ratio) {
@@ -23,7 +23,7 @@ void CommonBuilder::create_context(float dynamic_objects_ratio) {
     for (size_t i = 0; i < rooms_row * rooms_col * dynamic_objects_ratio; i++) {
         id = std::rand() % empty_rooms_buffer.size();
         auto enemy = std::make_unique<Enemy>();
-        enemy->set_location(empty_rooms_buffer.at(i));
+        enemy->set_location(empty_rooms_buffer.at(id));
         m_context.dynamic_objects.emplace_back(std::move(enemy));
     }
 
@@ -123,24 +123,66 @@ void ComplexBuilder::create_rooms() {
 }
 
 void ComplexBuilder::set_rooms_sides() {
-    for (size_t row = 0; row < m_rooms.size(); ++row)
-        for (size_t col = 0; col < m_rooms[0].size(); ++col) {
-            m_rooms[row][col]->set_side(Room::UP, std::make_shared<Wall>(*m_rooms[row][col]));
-            m_rooms[row][col]->set_side(Room::DOWN, std::make_shared<Wall>(*m_rooms[row][col]));
-            m_rooms[row][col]->set_side(Room::LEFT, std::make_shared<Wall>(*m_rooms[row][col]));
-            m_rooms[row][col]->set_side(Room::RIGHT, std::make_shared<Wall>(*m_rooms[row][col]));
+    size_t cols = m_rooms[0].size();
+    size_t rows = m_rooms.size();
+    for (int j = 0; j < cols; j++) {
+        m_rooms[0][j]->set_side(Room::Direction::UP, std::make_unique<Wall>(*m_rooms[0][j]));
+    }
+    for (int j = 0; j < cols; j++) {
+        m_rooms[rows - 1][j]->set_side(Room::Direction::DOWN, std::make_unique<Wall>(*m_rooms[rows - 1][j]));
+        if (j != cols - 1) {
+            m_rooms[rows  - 1][j]->set_side(Room::Direction::RIGHT, std::make_unique<Pass>(*m_rooms[rows - 1][j], *m_rooms[rows - 1][j+1]));
+            m_rooms[rows - 1][j+1]->set_side(Room::Direction::LEFT, std::make_unique<Pass>(*m_rooms[rows - 1][j+1], *m_rooms[rows - 1][j]));
+        }
+    }
+    for (int i = 0; i < rows ; i++) {
+        m_rooms[i][0]->set_side(Room::Direction::LEFT, std::make_unique<Wall>(*m_rooms[i][0]));
+    }
+    for (int i = 0; i < rows; i++) {
+        m_rooms[i][cols - 1]->set_side(Room::Direction::RIGHT, std::make_unique<Wall>(*m_rooms[i][cols - 1]));
+    }
+
+    std::vector<int> row(cols);
+    int count = 0;
+    for (; count < cols; row[count] = count, count++);
+    for (int i = 0; i < rows - 1; i++) {
+        for (int j = 0; j < cols - 1; j++) {
+            if (rand() % 2) {
+                m_rooms[i][j]->set_side(Room::Direction::RIGHT, std::make_unique<Wall>(*m_rooms[i][j]));
+                m_rooms[i][j+1]->set_side(Room::Direction::LEFT, std::make_unique<Wall>(*m_rooms[i][j+1]));
+            }
+            else {
+                m_rooms[i][j]->set_side(Room::Direction::RIGHT, std::make_unique<Pass>(*m_rooms[i][j], *m_rooms[i][j+1]));
+                m_rooms[i][j+1]->set_side(Room::Direction::LEFT, std::make_unique<Pass>(*m_rooms[i][j+1], *m_rooms[i][j]));
+                int temp = row[j + 1];
+                for (int k = 0; k < cols; k++) {
+                    if (row[k] == temp) row[k] = row[j];
+                }
+            }
         }
-    for (size_t row = 1; row < m_rooms.size(); ++row)
-        for (size_t col = 1; col < m_rooms[0].size(); ++col) {
-            if (col % 2 == 1) {
-                auto pass = std::make_shared<Pass>(*m_rooms[row][col], *m_rooms[row - 1][col]);
-                m_rooms[row][col]->set_side(Room::UP, pass);
-                m_rooms[row - 1][col]->set_side(Room::DOWN, pass);
+        for (int j = 0; j < cols; j++) {
+            if (rand() % 2) {
+                int temp = 0;
+                for (int k = 0; k < cols; k++) {
+                    if (row[k] == row[j] && !m_rooms[i][k]->get_side(Room::Direction::DOWN)) temp++;
+                }
+                if (temp > 1) {
+                    m_rooms[i][j]->set_side(Room::Direction::DOWN, std::make_unique<Wall>(*m_rooms[i][j]));
+                    m_rooms[i+1][j]->set_side(Room::Direction::UP, std::make_unique<Wall>(*m_rooms[i+1][j]));
+                }
+                else {
+                    m_rooms[i][j]->set_side(Room::Direction::DOWN, std::make_unique<Pass>(*m_rooms[i][j], *m_rooms[i+1][j]));
+                    m_rooms[i+1][j]->set_side(Room::Direction::UP, std::make_unique<Pass>(*m_rooms[i+1][j], *m_rooms[i][j]));
+                }
             }
-            if (row % 2 == 1) {
-                auto pass = std::make_shared<Pass>(*m_rooms[row][col], *m_rooms[row][col-1]);
-                m_rooms[row][col]->set_side(Room::LEFT, pass);
-                m_rooms[row][col-1]->set_side(Room::RIGHT, pass);
+            else {
+                m_rooms[i][j]->set_side(Room::Direction::DOWN, std::make_unique<Pass>(*m_rooms[i][j], *m_rooms[i+1][j]));
+                m_rooms[i+1][j]->set_side(Room::Direction::UP, std::make_unique<Pass>(*m_rooms[i+1][j], *m_rooms[i][j]));
             }
         }
-}
\ No newline at end of file
+        for (int j = 0; j < cols; j++) {
+            if (m_rooms[i][j]->get_side(Room::Direction::DOWN)) row[j] = count++;
+        }
+    }
+
+}
-- 
GitLab


From bd303fdd353855466030ca887c9e2f4011d4c0bc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A3=D1=88=D0=BA=D0=BE=D0=B2=D0=B0=20=D0=94=D0=B8=D0=B0?=
 =?UTF-8?q?=D0=BD=D0=B0=20=D0=9F=D0=B5=D1=82=D1=80=D0=BE=D0=B2=D0=BD=D0=B0?=
 <dpushkova@edu.hse.ru>
Date: Wed, 5 Mar 2025 16:03:32 +0300
Subject: [PATCH 3/6] started to create texture

---
 CMakeLists.txt                                |   3 +-
 .../application/BobBuilder/GameBuilders.cpp   |   4 +
 source/application/Context/Context.cpp        |   2 +-
 source/application/Context/Context.h          |   7 +-
 .../application/Drawable/Entity/IEntity.cpp   |  11 +-
 source/application/Drawable/Entity/IEntity.h  |   9 +-
 source/application/Drawable/Entity/Pacman.cpp |  20 +-
 source/application/Drawable/Entity/Pacman.h   |   6 +-
 source/application/Drawable/Maze/Maze.h       |   3 +-
 .../SelectCommand/ISelectCommand.cpp          |   2 -
 source/application/State/GameState.cpp        |   8 +-
 source/application/State/IState.cpp           |   2 -
 source/main.cpp                               | 225 ++++++++++++++++++
 13 files changed, 272 insertions(+), 30 deletions(-)
 delete mode 100644 source/application/SelectCommand/ISelectCommand.cpp
 delete mode 100644 source/application/State/IState.cpp

diff --git a/CMakeLists.txt b/CMakeLists.txt
index cc0696b..6bb6638 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,7 +8,8 @@ FetchContent_Declare(SFML GIT_REPOSITORY https://github.com/SFML/SFML.git GIT_TA
 FetchContent_MakeAvailable(SFML)
 
 file(GLOB_RECURSE SOURCE_CPP source/*.cpp)
-add_executable(pacman ${SOURCE_CPP})
+file(GLOB_RECURSE SOURCE_H source/*.h)
+add_executable(pacman ${SOURCE_CPP} ${SOURCE_H})
 
 target_link_libraries(pacman PRIVATE sfml-window sfml-graphics sfml-system)
 target_compile_definitions(pacman PRIVATE ASSETS_PATH="${CMAKE_CURRENT_SOURCE_DIR}/workdir/assets/")
diff --git a/source/application/BobBuilder/GameBuilders.cpp b/source/application/BobBuilder/GameBuilders.cpp
index 5e6f8b6..3b89381 100644
--- a/source/application/BobBuilder/GameBuilders.cpp
+++ b/source/application/BobBuilder/GameBuilders.cpp
@@ -13,6 +13,8 @@ void CommonBuilder::create_context(float dynamic_objects_ratio) {
 
     float id = std::rand() % empty_rooms_buffer.size();
     //в рандомное место располагаем пакмана
+    m_context.m_pacman_texture = new PacmanTexture();
+    m_context.pacman.set_texture(m_context.m_pacman_texture);
     m_context.pacman.set_location(empty_rooms_buffer[id]);
     auto it = std::next(empty_rooms_buffer.begin(), id);
     empty_rooms_buffer.erase(it);
@@ -28,9 +30,11 @@ void CommonBuilder::create_context(float dynamic_objects_ratio) {
     }
 
     //располагаем еду
+    m_context.m_food_texture = new FoodTexture();
     for (auto it : empty_rooms_buffer) {
         auto food = std::make_unique<Food>();
         food->set_location(it);
+        food->set_texture(m_context.m_food_texture);
         m_context.static_objects.emplace_back(std::move(food));
     }
     empty_rooms_buffer.clear();
diff --git a/source/application/Context/Context.cpp b/source/application/Context/Context.cpp
index fe23398..fe3ae59 100644
--- a/source/application/Context/Context.cpp
+++ b/source/application/Context/Context.cpp
@@ -14,13 +14,13 @@ GameContext GameContext::clone() {
     return context;
 }
 
-//@todo
 void ContextManager::restore_previous_context() {
     if (m_history.size() == 1) {
         m_initial_context = m_history.top().clone();
         return;
     }
     m_initial_context = std::move(m_history.top());
+    m_history.pop();
 }
 
 void ContextManager::reset(GameContext &&context) {
diff --git a/source/application/Context/Context.h b/source/application/Context/Context.h
index 456d2e3..785b985 100644
--- a/source/application/Context/Context.h
+++ b/source/application/Context/Context.h
@@ -4,13 +4,14 @@
 #include <istream>
 #include <list>
 
-class GameContext {
-public:
+struct GameContext {
     enum State { INGAME, WIN, LOST } state = INGAME;
     std::list<std::unique_ptr<IDynamicEntity>> dynamic_objects;
     std::list<std::unique_ptr<IStaticEntity>> static_objects;
+    std::vector<MyTexture*> m_textures;
+    MyTexture* m_pacman_texture;
+    MyTexture* m_food_texture;
     Pacman pacman;
-public:
     GameContext clone();
 };
 
diff --git a/source/application/Drawable/Entity/IEntity.cpp b/source/application/Drawable/Entity/IEntity.cpp
index 5b920fa..538e771 100644
--- a/source/application/Drawable/Entity/IEntity.cpp
+++ b/source/application/Drawable/Entity/IEntity.cpp
@@ -7,9 +7,9 @@ void IEntity::set_location(Room* ptr_room) {
 }
 
 Food::Food() {
-    m_shape = sf::CircleShape(config::GAME_FOOD_SIZE);
+    m_shape = sf::CircleShape(config::GAME_FOOD_SIZE/2);
+    m_shape.setOrigin({ config::GAME_FOOD_SIZE/2, config::GAME_FOOD_SIZE/2 });
     m_shape.setFillColor(config::GAME_FOOD_COLOR);
-    m_shape.setOrigin({config::GAME_FOOD_SIZE/2, config::GAME_FOOD_SIZE/2});
 }
 
 std::unique_ptr<IStaticEntity> Food::clone() const {
@@ -17,7 +17,11 @@ std::unique_ptr<IStaticEntity> Food::clone() const {
 }
 
 void Food::prepare_for_drawing() {
+    if (m_ptr_texture)
+        m_sprite.setTexture(m_ptr_texture->get_texture());
+    else throw std::runtime_error("Can't load Food!");
     m_shape.setPosition(m_ptr_room->get_position());
+    m_sprite.setPosition(m_ptr_room->get_position()+sf::Vector2f(-20, -20));
 }
 
 std::unique_ptr<IGameEvent> Enemy::accept(IVisitor* ptr_visitor) {
@@ -28,10 +32,9 @@ std::unique_ptr<IGameEvent> Food::accept(IVisitor* ptr_visitor) {
     return ptr_visitor->visit(this);
 }
 
-
 void Food::draw_into(sf::RenderWindow& window) {
     m_shape.setPosition(m_ptr_room->get_position());
-    window.draw(m_shape);
+    window.draw(m_sprite);
 }
 
 Enemy::Enemy() {
diff --git a/source/application/Drawable/Entity/IEntity.h b/source/application/Drawable/Entity/IEntity.h
index 6a83d09..43a9788 100644
--- a/source/application/Drawable/Entity/IEntity.h
+++ b/source/application/Drawable/Entity/IEntity.h
@@ -2,6 +2,7 @@
 
 #include "../IDrawable.h"
 #include "../../Event/IGameEvent.h"
+#include "MyTexture.h"
 
 class Room;
 class Food;
@@ -30,6 +31,9 @@ public:
 class IStaticEntity : public IEntity, public IVisitable {
 public:
     virtual std::unique_ptr<IStaticEntity> clone() const = 0;
+    virtual void set_texture(MyTexture* ptr_texture) {m_ptr_texture = ptr_texture; }
+protected:
+    MyTexture* m_ptr_texture;
 };
 
 class IDynamicEntity: public IEntity, public IVisitable {
@@ -52,14 +56,17 @@ private:
     sf::Clock m_clock;
 };
 
-class Food: public IStaticEntity {
+class Food: public IStaticEntity{
 public:
     Food();
     void draw_into(sf::RenderWindow& window) override;
     void prepare_for_drawing() override;
+    void set_texture(MyTexture* ptr_texture) override { m_ptr_texture = ptr_texture; }
     std::unique_ptr<IStaticEntity>  clone() const override;
     std::unique_ptr<IGameEvent> accept(IVisitor* ptr_visitor) override;
     ~Food() override {};
 private:
     sf::CircleShape m_shape;
+    sf::Sprite m_sprite;
+    sf::Texture m_texture;
 };
\ No newline at end of file
diff --git a/source/application/Drawable/Entity/Pacman.cpp b/source/application/Drawable/Entity/Pacman.cpp
index e20ab2d..fd04bc2 100644
--- a/source/application/Drawable/Entity/Pacman.cpp
+++ b/source/application/Drawable/Entity/Pacman.cpp
@@ -2,30 +2,34 @@
 #include "../../../../workdir/config.h"
 
 Pacman::Pacman() {
-    m_shape = sf::CircleShape(config::GAME_PACMAN_SIZE/2);
+    m_shape = sf::CircleShape(config::GAME_PACMAN_SIZE);
     m_shape.setFillColor(config::GAME_COLOR_PACMAN);
-    m_shape.setOrigin({config::GAME_PACMAN_SIZE/2, config::GAME_PACMAN_SIZE/2});
+    m_shape.setOrigin({config::GAME_PACMAN_SIZE, config::GAME_PACMAN_SIZE});
 }
 
 void Pacman::move(Room::Direction direction) {
     m_ptr_room->get_side(direction)->enter(this);
+    m_ptr_texture->set_direction(static_cast<MyTexture::Direction>(direction));
 }
 
 void Pacman::prepare_for_drawing() {
-    m_shape.setPosition(m_ptr_room->get_position());
+    if (m_ptr_texture)
+        m_sprite.setTexture(m_ptr_texture->get_texture());
+    else throw std::runtime_error("Can't load Pacman!");
+    m_sprite.setPosition(m_ptr_room->get_position()+sf::Vector2f(-20, -20));
 }
 
-std::unique_ptr<IGameEvent> Pacman::visit(Food *ptr_food) {
+std::unique_ptr<IGameEvent> Pacman::visit(Food* ptr_food) {
     if (ptr_food->get_location() != this->get_location()) return {};
     return std::make_unique<DeleteStaticEntity>(ptr_food);
 }
 
-std::unique_ptr<IGameEvent> Pacman::visit(Enemy *ptr_enemy) {
+std::unique_ptr<IGameEvent> Pacman::visit(Enemy* ptr_enemy) {
     if (ptr_enemy->get_location() != this->get_location()) return {};
     return std::make_unique<LostGame>();
 }
 
-void Pacman::draw_into(sf::RenderWindow &window) {
+void Pacman::draw_into(sf::RenderWindow& window) {
     prepare_for_drawing();
-    window.draw(m_shape);
-}
+    window.draw(m_sprite);
+}
\ No newline at end of file
diff --git a/source/application/Drawable/Entity/Pacman.h b/source/application/Drawable/Entity/Pacman.h
index 8e5f5f6..3f38479 100644
--- a/source/application/Drawable/Entity/Pacman.h
+++ b/source/application/Drawable/Entity/Pacman.h
@@ -2,16 +2,20 @@
 
 #include "IEntity.h"
 #include "../Maze/Maze.h"
+#include "MyTexture.h"
 
 class Pacman : public IEntity, public IVisitor {
 public:
     Pacman();
     void move(Room::Direction direction);
     void prepare_for_drawing() override;
+    void set_texture(MyTexture* ptr_texture) { m_ptr_texture = ptr_texture; }
     void draw_into(sf::RenderWindow& window) override;
     std::unique_ptr<IGameEvent> visit(Food* ptr_entity) override;
     std::unique_ptr<IGameEvent> visit(Enemy* ptr_entity) override;
     ~Pacman() override {};
 private:
     sf::CircleShape m_shape;
-};
\ No newline at end of file
+    sf::Sprite m_sprite;
+    MyTexture* m_ptr_texture;
+};
diff --git a/source/application/Drawable/Maze/Maze.h b/source/application/Drawable/Maze/Maze.h
index 967923d..1b7219a 100644
--- a/source/application/Drawable/Maze/Maze.h
+++ b/source/application/Drawable/Maze/Maze.h
@@ -13,7 +13,6 @@ public:
 class Room: public IDrawable {
 public:
     enum Direction { INVALID = -1, LEFT, RIGHT, UP, DOWN };
-
     explicit Room(float size);
     float get_size() { return m_rectangle.getSize().x; }
     void set_position(sf::Vector2f pos) { m_rectangle.setPosition(pos); }
@@ -31,7 +30,7 @@ public:
 class Maze: public IDrawable {
 public:
     Maze() = default;
-    Maze(std::vector<Room*>& rooms) : m_rooms(rooms) {};
+    explicit Maze(std::vector<Room*>& rooms) : m_rooms(rooms) {};
     void draw_into(sf::RenderWindow& m_window) override;
 private:
     std::vector<Room*> m_rooms;
diff --git a/source/application/SelectCommand/ISelectCommand.cpp b/source/application/SelectCommand/ISelectCommand.cpp
deleted file mode 100644
index 4669ecd..0000000
--- a/source/application/SelectCommand/ISelectCommand.cpp
+++ /dev/null
@@ -1,2 +0,0 @@
-#include "ISelectCommand.h"
-
diff --git a/source/application/State/GameState.cpp b/source/application/State/GameState.cpp
index 60f409b..db705ac 100644
--- a/source/application/State/GameState.cpp
+++ b/source/application/State/GameState.cpp
@@ -57,9 +57,9 @@ void GameState::update() {
         if (ptr_event)  game_events.emplace_back(std::move(ptr_event));
     }
 
-    for (int i = 0; i < game_events.size(); i++) {
+    for (int i = 0; i < game_events.size(); i++)
         game_events[i]->handle(&m_context_manager.get_current_context());
-    }
+
     if (context.static_objects.empty()) {
         game_events.emplace_back(std::move(std::make_unique<WinGame>()));
     }
@@ -80,10 +80,8 @@ void GameState::render() {
     }
     m_maze.draw_into(m_window);
     context.pacman.draw_into(m_window);
-    for (auto& obj :  context.static_objects) {
+    for (auto& obj :  context.static_objects)
         obj->draw_into(m_window);
-    }
-
 
     for (auto& el : context.dynamic_objects)
         el->draw_into(m_window);
diff --git a/source/application/State/IState.cpp b/source/application/State/IState.cpp
deleted file mode 100644
index 528669c..0000000
--- a/source/application/State/IState.cpp
+++ /dev/null
@@ -1,2 +0,0 @@
-#include "IState.h"
-
diff --git a/source/main.cpp b/source/main.cpp
index 688c439..675d3f8 100644
--- a/source/main.cpp
+++ b/source/main.cpp
@@ -4,4 +4,229 @@ int main() {
     Application app;
     return app.run();
 }
+//
+//#include "ExperimentState.h"
+//#include <QTimer>
+//#include <QtCharts/QChart>
+//#include <QtCharts/QChartView>
+//#include <QtCharts/QLineSeries>
+//using namespace QtCharts;
+//#include <QtCore/QPointF>
+//#include <QtCharts/QValueAxis>
+//class RateLabel : public QWidget {
+//public:
+//    RateLabel(const QString& rate, QWidget* parent = nullptr) : QWidget(parent) {
+//        QHBoxLayout* layout = new QHBoxLayout(this);
+//        layout->setContentsMargins(0, 0, 0, 0); // Отступ слева
+//
+//        // Создаем метку с текстом
+//        QLabel* rateLabel = new QLabel(QString("\u03B5\u0307 = ") + rate); // Используем юникод для эпсилон с точкой
+//        rateLabel->setStyleSheet("color: #9E9E9E;"); // Цвет текста
+//        QFont font = rateLabel->font();
+//        font.setPointSize(16); // Размер шрифта
+//        rateLabel->setFont(font);
+//
+//        // Добавляем метку в макет
+//        layout->addWidget(rateLabel);
+//        layout->addStretch();
+//    }
+//};
+//
+//class CircleWidget: public QWidget {
+//    Q_OBJECT
+//public:
+//    explicit CircleWidget(QWidget* parent = nullptr) : QWidget(parent) {
+//        setFixedSize(30, 30);
+//    }
+//protected:
+//    void paintEvent(QPaintEvent* event) override {
+//        QPainter painter(this);
+//        int radius = width() /2;
+//        painter.drawEllipse((width()-radius)/2, (height()-radius)/2, radius, radius);
+//    }
+//};
+//class Progress: public QObject {
+//    Q_OBJECT
+//public:
+//    QHBoxLayout* progressBar() {
+//        m_progress = new QProgressBar;
+//        m_progress->setRange(0, 5);
+//        m_progress->setFixedWidth(300);
+//        m_progress->setFixedHeight(20);
+//        m_progress->setStyleSheet(
+//                "QProgressBar {"
+//                "    border: 1px solid grey;"
+//                "    border-radius: 10px;"
+//                "    background-color: #4A4849;"
+//                "    color: transparent;"
+//                "    font-weight: bold;"
+//                "}"
+//                "QProgressBar::chunk {"
+//                "    background-color: #52C7FA;"
+//                "    border-radius: 8px;"
+//                "}"
+//        );
+//        m_progress->setTextVisible(false);
+//        QHBoxLayout* phbxLayout = new QHBoxLayout;
+//        phbxLayout->addWidget(m_progress, 0, Qt::AlignLeft);
+//
+//        m_timer = new QTimer(this);
+//        connect(m_timer, &QTimer::timeout, this, &Progress::updateProgress); //запускаем каждую секунду
+//        return phbxLayout;
+//    }
+//
+//public slots:
+//    void updateProgress() {
+//        if (m_step < 5) {
+//            m_progress->setValue(++m_step);
+//        } else {
+//            m_timer->stop();
+//            emit progressFinished(); //сигнал, что закончили
+//        }
+//    }
+//
+//    void startProgress() {
+//        m_step = 0;
+//        m_progress->setValue(0);
+//        m_timer->start(1000); //обновление прогресса
+//    }
+//
+//    signals:
+//            void progressFinished();
+//
+//private:
+//    QProgressBar* m_progress;
+//    QTimer* m_timer;
+//    int m_step = 0;
+//};
+//
+//QHBoxLayout* ExperimentState::create_ui() {
+//    QHBoxLayout* mainLayout = new QHBoxLayout;
+//    QVBoxLayout* layout = new QVBoxLayout;
+//    QTableWidget* tbl = new QTableWidget(3, 4);
+//    QTableWidgetItem* ptwi = 0;
+//    QStringList lst, lst2;
+//    lst << "в„–1" << "в„–2" << "в„–3" << "+";
+//    lst2 << "Входные данные" << "Модель материала" << "Выходные кривые";
+//    tbl->setHorizontalHeaderLabels(lst);
+//    tbl->setVerticalHeaderLabels(lst2);
+//    tbl->setFixedSize(240, 110);
+//    tbl->setColumnWidth(0,30);
+//    tbl->setColumnWidth(1,30);
+//    tbl->setColumnWidth(2,30);
+//    tbl->setColumnWidth(3,30);
+//    tbl->setColumnWidth(4,30);
+//    tbl->setStyleSheet("QTableWidget::Item {border: 1px solid #5B5B5B;}");
+//    for (int row = 0; row < 3; row++) {
+//        for (int col = 0; col < 4; col++) {
+//            CircleWidget* circleWidget = new CircleWidget();
+//            tbl->setCellWidget(row, col, circleWidget);
+//        }
+//    }
+//    layout->addWidget(tbl);
+//    QLabel* text_status = new QLabel("Статус");
+//    text_status->setStyleSheet("color: #9E9E9E;");
+//    QFont font = text_status->font();
+//    font.setPointSize(16); //размер шрифта
+//    font.setBold(true); //жирный шрифт
+//    text_status->setFont(font);
+//    QLabel* tex_iter = new QLabel("Текущая итерация: 1");
+//    tex_iter->setStyleSheet("color: #9E9E9E;");
+//    QLabel* build_model = new QLabel("Построение модели материала");
+//    build_model->setStyleSheet("color: #9E9E9E;");
+//    QLabel* build_mke = new QLabel("Конечно элементное моделирование");
+//    build_mke->setStyleSheet("color: #9E9E9E;");
+//
+//    Progress* prog1 = new Progress;
+//    Progress* prog2 = new Progress;
+//    QLabel* text = new QLabel("Просмотр моделирования");
+//    text->setStyleSheet("color: #9E9E9E;");
+//    QFont font2 = text->font();
+//    font2.setPointSize(16); //размер шрифта
+//    font2.setBold(true); //жирный шрифт
+//    text->setFont(font2);
+//
+//    QComboBox* cbo = new QComboBox;
+//    QStringList list;
+//    list << "Итерация №1" << "Итерация №2" << "Итерация №3";
+//    cbo->addItems(list);
+//    cbo->setEditable(true);
+//    cbo->setFixedWidth(130);
+//    QWidget* rateButtonsWidget = new QWidget;
+//    QGridLayout* gridLayout = new QGridLayout(rateButtonsWidget);
+//    gridLayout->setSpacing(5);
+//    gridLayout->addWidget(new RateLabel("0.002"), 0, 0);
+//    gridLayout->addWidget(new RateLabel("0.03"), 0, 1);
+//    gridLayout->addWidget(new RateLabel("0.005"), 1, 0);
+//    gridLayout->addWidget(new RateLabel("0.05"), 1, 1);
+//    gridLayout->addWidget(new RateLabel("0.01"), 2, 0);
+//
+//    layout->addWidget(text_status);
+//    layout->addWidget(tex_iter);
+//    layout->addWidget(build_model);
+//    layout->addLayout(prog1->progressBar());
+//    layout->addWidget(build_mke);
+//    layout->addLayout(prog2->progressBar());
+//    prog1->startProgress();
+//    layout->addWidget(text);
+//    layout->addWidget(cbo);
+//    layout->addWidget(rateButtonsWidget);
+//    mainLayout->addLayout(layout);
+//    // Создаём представление для графика
+//    QChart *chart = new QChart();
+//    chart->setTitleBrush(QBrush(Qt::white));
+//    chart->legend()->hide();
+//
+//    QLineSeries *series1 = new QLineSeries();
+//    series1->append(0.0, 3.0);
+//    series1->append(0.1, 4.0);
+//    series1->append(0.2, 5.5);
+//    series1->append(0.3, 8.2);
+//    series1->append(0.4, 9.8);
+//    series1->append(0.5, 10.2);
+//    series1->append(0.6, 10.0);
+//    series1->append(0.7, 11.4);
+//    series1->append(0.8, 12.4);
+//    series1->append(0.9, 11.8);
+//    series1->append(1.0, 10.5);
+//    QPen pen1(QColor(135, 206, 235));
+//    pen1.setWidth(2);
+//    pen1.setStyle(Qt::PenStyle::DashLine);
+//    series1->setPen(pen1);
+//    chart->addSeries(series1);
+//
+//    QValueAxis* axisX = new QValueAxis();
+//    axisX->setRange(0.0, 1.1);
+//    axisX->setLabelFormat("%.1f");
+//    axisX->setTickCount(12);
+//    axisX->setLabelsColor(QColor(158, 158, 158));
+//    axisX->setTitleText("Деформация, -");
+//    axisX->setTitleBrush(QColor(158, 158, 158));
+//    axisX->setGridLineColor(QColor(158, 158, 158));
+//    chart->addAxis(axisX, Qt::AlignBottom);
+//    series1->attachAxis(axisX);
+//
+//    chart->setBackgroundBrush(Qt::transparent);
+//    chart->setPlotAreaBackgroundBrush(Qt::transparent);
+//    chart->setPlotAreaBackgroundVisible(true);
+//
+//    QValueAxis *axisY = new QValueAxis();
+//    axisY->setRange(0.0, 15.0);
+//    axisY->setTickCount(9);
+//    axisY->setLabelFormat("%.0f");
+//    axisY->setLabelsColor(QColor(158, 158, 158));
+//    axisY->setTitleText("Напряжение, МPa");
+//    axisY->setTitleBrush(QColor(158, 158, 158));
+//    axisY->setGridLineColor(QColor(158, 158, 158));
+//    chart->addAxis(axisY, Qt::AlignLeft);
+//    series1->attachAxis(axisY);
+//    QChartView *chartView = new QChartView(chart);
+////    chartView->setRenderHint(QPainter::Antialiasing);
+//    chartView->setMinimumSize(500, 350);
+//    chartView->setStyleSheet("background-color: transparent;");
+//    mainLayout->addWidget(chartView);
+//    connect(prog1, &Progress::progressFinished, [prog2]() {prog2->startProgress();});
+//    return mainLayout;
+//}
+//#include "ExperimentState.moc"
 
-- 
GitLab


From 7aa56d2a0e697cbd71a64b78f1f70778077f1714 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A3=D1=88=D0=BA=D0=BE=D0=B2=D0=B0=20=D0=94=D0=B8=D0=B0?=
 =?UTF-8?q?=D0=BD=D0=B0=20=D0=9F=D0=B5=D1=82=D1=80=D0=BE=D0=B2=D0=BD=D0=B0?=
 <dpushkova@edu.hse.ru>
Date: Wed, 5 Mar 2025 16:13:09 +0300
Subject: [PATCH 4/6] texture for pacman

---
 .../application/Drawable/Entity/MyTexture.cpp |  26 +++++++++++++++
 .../application/Drawable/Entity/MyTexture.h   |  30 ++++++++++++++++++
 workdir/assets/apple.png                      | Bin 0 -> 7216 bytes
 workdir/assets/pacman.png                     | Bin 0 -> 2732 bytes
 workdir/assets/pacmanDown.png                 | Bin 0 -> 2263 bytes
 workdir/assets/pacmanLeft.png                 | Bin 0 -> 2247 bytes
 workdir/assets/pacmanRight.png                | Bin 0 -> 2217 bytes
 workdir/assets/pacmanUp.png                   | Bin 0 -> 2237 bytes
 8 files changed, 56 insertions(+)
 create mode 100644 source/application/Drawable/Entity/MyTexture.cpp
 create mode 100644 source/application/Drawable/Entity/MyTexture.h
 create mode 100644 workdir/assets/apple.png
 create mode 100644 workdir/assets/pacman.png
 create mode 100644 workdir/assets/pacmanDown.png
 create mode 100644 workdir/assets/pacmanLeft.png
 create mode 100644 workdir/assets/pacmanRight.png
 create mode 100644 workdir/assets/pacmanUp.png

diff --git a/source/application/Drawable/Entity/MyTexture.cpp b/source/application/Drawable/Entity/MyTexture.cpp
new file mode 100644
index 0000000..a12402f
--- /dev/null
+++ b/source/application/Drawable/Entity/MyTexture.cpp
@@ -0,0 +1,26 @@
+#include "MyTexture.h"
+
+PacmanTexture::PacmanTexture() {
+    m_texture_up.loadFromFile(std::string(ASSETS_PATH) + "pacmanUp.png");
+    m_texture_down.loadFromFile(std::string(ASSETS_PATH) + "pacmanDown.png");
+    m_texture_right.loadFromFile(std::string(ASSETS_PATH) + "pacmanRight.png");
+    m_texture_left.loadFromFile(std::string(ASSETS_PATH) + "pacmanLeft.png");
+}
+
+//в зависимости от направления - разные текстуры
+sf::Texture& PacmanTexture::get_texture() {
+    switch (m_direction) {
+        case Direction::UP:
+            return m_texture_left;
+        case Direction::DOWN:
+            return m_texture_right;
+        case Direction::RIGHT:
+            return m_texture_up;
+        case Direction::LEFT:
+            return m_texture_down;
+    }
+}
+
+FoodTexture::FoodTexture() {
+    m_texture_food.loadFromFile(std::string(ASSETS_PATH) + "apple.png");
+}
\ No newline at end of file
diff --git a/source/application/Drawable/Entity/MyTexture.h b/source/application/Drawable/Entity/MyTexture.h
new file mode 100644
index 0000000..bf7d051
--- /dev/null
+++ b/source/application/Drawable/Entity/MyTexture.h
@@ -0,0 +1,30 @@
+#pragma once
+
+#include "SFML/Graphics.hpp"
+
+class MyTexture {
+public:
+    enum Direction {UP, DOWN, RIGHT, LEFT};
+    virtual sf::Texture& get_texture() = 0;
+    void set_direction(Direction direction) {m_direction = direction;}
+protected:
+    Direction m_direction = UP;
+};
+
+//texture for Pacman
+class PacmanTexture : public MyTexture {
+public:
+    PacmanTexture();
+    sf::Texture& get_texture() override;
+private:
+    sf::Texture m_texture_up, m_texture_down, m_texture_right, m_texture_left;
+};
+
+//texture for Food
+class FoodTexture : public MyTexture {
+public:
+    FoodTexture();
+    sf::Texture& get_texture() override {return m_texture_food;};
+private:
+    sf::Texture m_texture_food;
+};
\ No newline at end of file
diff --git a/workdir/assets/apple.png b/workdir/assets/apple.png
new file mode 100644
index 0000000000000000000000000000000000000000..3b35620e0afceae9e59995fcdc358ce3422112fb
GIT binary patch
literal 7216
zcmeHMc~p{V+sDeZl}cx@EGfgKa<J4~Qem=8F-04vF&oqh({RBxamOah5|a@#7gXA`
z&1GB?5e>_bD3_GX6ajZLMN|?}1U{Va`~G{+`QG#W)qBo7=RD^*_jS&5pX<7>?RWj|
zn;uA~P3w282LJ$@5YESc0RUE|ue_RTRg#A2_zcx&O_T%TS54KEsOf)0wO$wQ>>ULF
zY}mH)s&(^{msP@@(T-=LJ;MT`apxm10*?BJUAVaW1Saw#E-W%QYWFcu%g>F~s?Btt
zB90&ZHMUU5V-O*eNrE}|%bn9aVKK7NAi^%41-^fYZMgB(6_cOMLX6g`9ZR{?oVjL8
zsj&IVs<n06)=}ql4i37$&B;qy{c;vO_$CF<-r{_u>l8%2ICJo&cG$i+se~1cvw2)G
zRWOdj1;zx@pT_%|-aTaBVl&&<A6OhO_3Wu}<JPGGQj!Q&8UR4E#X3g-z{O!JAcf?y
z25=Xmtp+guNAz!>M6{U%P(d!mwCcSQ$J(>YA&=0&RB!8(k*4gTDvd}r)<Nn-bmLHd
zZK$neOGQ!ZQFz(*v|%y=n`y5ZFnJXsx@CXE$hwYZzc8|?)3s)2v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p$Jlqd5(`-K#6QMxmy><&teUxd4L2;My(fFY~t
zrd7n(3R(RQ`Nj7`Gw*_Cb$lyoW>LO}sqT@<SgD_gL7C|7>`6{b#A8K%>6TQ#-T!?A
zmO{SRtwC#iKi%hw;`r3@_~+M+-YyJQ;kP~ShLhzq9(Y0_R_HmJrd0Ui8)YB|`2e5N
zt1{n7W&U*|&XAi@j`+a-8ua`sQ9h@aJo;rLacWjQizdJDYZRAWNc%BWpY_zQQKof?
zF1Oz3=vx@{h`DYd=+`JZzJm~mjViBqTDjc8C4DbE@^?XI|DQ@sDpwyMFEyG+%wAI6
P?g0>v$m10b=l=LF7&vF{

literal 0
HcmV?d00001

diff --git a/workdir/assets/pacman.png b/workdir/assets/pacman.png
new file mode 100644
index 0000000000000000000000000000000000000000..9dfa35d9d504f7e413ad1e5180b9821dfab11f3b
GIT binary patch
literal 2732
zcmZ{mc{J4BAIHB##+b;^Oxem<BMoDFEGaW%CuEu;Wou@bkuj5*N4AHtj6{@uU$PV)
zB}*u(q4dyV`cZ@sF|rm)Wcy9O-+6xL{Qh{(J)ir&=W{-<&pn^}IrrRq^`w)H1XK<R
z0Dy#@ttDQd2L*<NfCaM%rYi~nKnhd~i<49$5dbt&iQe9N4A!L}vb48%*J~|JXwYSR
zLc%q?w>gjdocjs@U+wM`NdbY5BZEC7Jr4_m*MgIyr7XSrMRGZs*Y`8j_QNxQ8FNfP
zMw)xUD=wD;ko>Z<;XtSCG%%=aH|V_zhP7&_cFA@f7b2}xSiE<|%&S5+#1cGqecN?o
zOQihxfmgm0K)$fgOZI!UDg-iIwqRxV;Uv92eS5e#3WY)_oLWxDBVx3Y9PrE}gxN~k
zN)mKAN!kH_itVqoC@hRkz@1E>0*3CCw9oVy04@pZpT;oO^b!lP2}+nCs*7w!cNghI
z&UG{~WtVX54jv57GKc7<dxGOdOvS}FPf1<yj~5pg`YA5H!3O~DbLXv+t1zoyheou;
zI|4wM8UV0k0bqScpq~K%4*@_3Hvllr27vwa0e8h4f>`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+N>kvdR42!x-{xUmyGl>x)>sksra&!9*Vc>TS`x%;H?
z%S>}q1+%P4;V|oKQ~7@kr#cz5Z=^j;faXR;lj@Zb4$F~OinGtzvv(_D%{R?ZadC#a
z7lwN0WzjzrBaP~oNa6g|xSsG^*o7j{T(0YAB7N<L<|C>xzwPK&fgSmo_r>hGPj8MA
z<)6m(E7ELC_j)UFO|nZ+3p$sEQ&j-(!QMTR?i<@bYu7ANRECYrzb&X7+v-=zt+9or
zX<as6R4^G$8#?7u%Bp?*YQytf_9gm}PG@Jgi#hl&Ge(N7OMZnq4-AKv_@Y%;M6DN|
zFhI6qfy2s~J<xkc2O3rMNZ~RnW3tzVqD+5cm+RKwX>V;G+F(b!w2c<5DZ9-zA*{2K
zXEys*8LRDDxY4dAo3J<QnOD7@yhnfAzNj*iXYZQR)ELflcW&FX-h7b%_*~EB#pI9C
zG-gAg)C%cpwuiq-@1lHtai6}jwcxIcDvd+e-aVvrh-L3<m=t#Y?l=^@)9){H>&<L-
zNR}^3YIvPhUaK@|b<PhA+^edC(>%bTYfZCi)%J<U7rP2pA69M6w||JnyTAI%e{9+|
zk_HVq-`G}hY~&`Duqk>Q{Y^77t~5mO{Hw97+*l+Z7TJ^-L>363ht@Mhq4iN{J%X;W
zsXp4&z)%Z~HbtZ7qHLc0A3&p%sJ@~94CE>A2nzs>|Lwq{(#TAf4~_B9%xk034+6&M
z7bEy^m=fuX&>*TGg#}pry+Z1mn3y23B>Dw1@>D33MW!*4c7a5C5Q82hD1f9JutO81
tK>nSAL}n6$s0<dB9tixG!rS1G8iFjwn)e>gt_orSJ1Zy4yEyNde*<>)&V2v?

literal 0
HcmV?d00001

diff --git a/workdir/assets/pacmanDown.png b/workdir/assets/pacmanDown.png
new file mode 100644
index 0000000000000000000000000000000000000000..18d63290bb82e97f70b629c745b29e4f8f443d5b
GIT binary patch
literal 2263
zcmcImdr%a096wDGB$LDkL63DYBw=6o;%@aqIF45x0$l>WVsH0%cN^U9dbhyA)HrHP
z0#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HLk_=^+;jD4D*cel=I0emUWIMN5ssx
zbofUfk9g*-CVR81wYX|@p?-D9qNXUz17QtyqaW|<JLz1%ei$DcSQcsNk**9}8UFN*
z-CupR8`C*JU(woAYtNMJ8I8#BC%(torr$TzE4|va#*fEe%e{%6ZHP+t<1T0K=lyln
zyEb<o$e!E3Wkc_M)E%<At}vU3@2cqydnDDgs3de1F&`;fc^4nlrE5E-W#MOHehk}E
z?mF^(R`^(J*kgUTt@HikCobEgTKA7Gxw7El`0L+i7!psX<`p<Bri-_;x899z$NFPl
z8Y|p*`p`&8+_ui2=ebp@PTP;pS@GqLxc>f#1?{5=^PhXUJt2KZf4im8*Jw44JsCb$
zUN6;-*w-wM+Bx!Sbxil%9bdn8&N#OF?BLd+(vX>G{_MU)Lv`x~U(+Wiy2!0tQfv3L
zg$l#ztBd@5L(~gH!geLL_GA~0J(%9s*Bu(Yab3gh!5fXmdGgL;|Ba!`Co3D?S$vg@
zwWTyh-ds8`>nBIV*SD6&XG_zMcFZT{-b^wOziMK;w-==3Z6-DxuK7JyNFU@wLKoD(
zKG4-VMC|{zk?!jW0sD^e&F9zjw&V(5beKEy+hTshTi$&v?^s!ChyBrlPI0h%Q-vXJ
zm(W#v{*^Ny+-bR#)$mdDwda<LZ#V5cRW|MU>XY9+J@eMW=E}O%M*pSAwJ+ig`r&=w
zP8$v_=zssgt1G{6iCA-d177FX_U42pKQxd-_sv}U+L`7{afSSCv-Hh=>BF&-;hVh=
z{BSYqg++(M=QM-1j;zQNM0ZQ=;H8o3lKa1$v3cZ)H;XUMI2$>b_e+Kp?QFPv0S}pX
zQ1&-v)WsZpw8o(OcnN1-b+X85v4%EU&RrLJwr|{Xq$hb=yMEJ)J(rEYD8C+AmYlRh
Isl}WB1pZ?yv;Y7A

literal 0
HcmV?d00001

diff --git a/workdir/assets/pacmanLeft.png b/workdir/assets/pacmanLeft.png
new file mode 100644
index 0000000000000000000000000000000000000000..cfad9cd3a0718cf3fe8a89621fe84d0254911c10
GIT binary pat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ets/pacmanRight.png b/workdir/assets/pacmanRight.png
new file mode 100644
index 0000000000000000000000000000000000000000..9613050a23c47f95d5e51ed3bcf44514e85e68ad
GIT binary patch
literal 2217
zcmcImc~I0=9A2rkirNB#V3jcwEQ*rNZZ_-@SsB~~L0uG~fZ&x)-Yyw-lXVl8l~P-;
z7LV$vt<xe_v9;EUI!GNYRVpf2FVJf79O=-hC-s<WWt@tAfo1D-tiwNjGfCci`QG>Y
zen)<jWz*6p4hniRNTE;+N=r3QhtJXS)$dh!U)j0e2_OAksWU`{V!&Ye>Z2&Hh*T&7
z&vIG0Qm$nR#RyI%%?eha^g3M-txzN+dR;VA2qeS`>>O`I?|uIRig2tE&55_DEG`o$
z;8IK6AhRSrizz8&3@n;B9!c<0kiZEf8u2<EyhwSCXcsR9=khj=B3%%v(1<3<29aFL
zG{hvh0TQp&VvL%MM|1|ITB{)qhB$;!sr9%@kE=D9T1$~CiXaf*K%q4^Yon%{Q+&4I
z%7_+7l8eIe;^Jauu|_Gl?YP=tFyJZzCkPB8FmXOF(O!%fqk9<4KxEvUOX36`kr`>L
zP$U^qsI=P!r^`>vi@q?yfZ<-+g{ze+*`*$!#qx5f)9FWxQnCkH@#%dbv6waA1@P%W
z6pGvoNcI3;itaJSGXAr!BDbT<Q<lMj12`c}gu>K*Q?3F*62t=GKm72&_Iu-^Om09+
zf;&qP96gDe*299BOmboj$mkr7XN6)hRu<(u1I)Apj3}WZNK6%vY1CP2k|Ib-LylEx
zD3z)kYJsJ|(h}V}u)uP*`MrT!EL0jVN;J=aG_w(fqLduRQU;)7RW>WY3_2)@(2)dY
z)mn9!Mx}|@X;__(U_qBIc-|~9MREk?^WBxp3Jm1%2Z>@yJ#Ezj0wYP%im^75#PkN6
z7Gnt&96Ca;156LwR5u4d9@_CdtE`HJjD$g_i6>bdW&kQZq#)r<r=>B1wb?XQn}LA)
zD8e$7O>jGDSSp;8wgcS7+fn2nH73C!xGe$;W3G`48nQz#QaKT3Z@%vn$prI!GY5xs
z)g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

diff --git a/workdir/assets/pacmanUp.png b/workdir/assets/pacmanUp.png
new file mode 100644
index 0000000000000000000000000000000000000000..62ba3dcdcaed1efe5e18561316b57dd2f7b39b95
GIT binary patch
literal 2237
zcmcImX;2eq7!KazIe4Iq$FdBUxY<pz3E9<vNKmLmRIsEXBb(hXha}mMT_h-$f-njy
zZJk<gJ6@w!ryjMGBA|kJ*P|+8wU%1zRL2e;QyqkH`YnXi>1gYpW@fYB?mpl1KJW9s
z`_7ilnmK)te~`aSCL5HLsGkGR5z^7G5By*Cs>%UR{auM42r}7#Vbb9z+qij@OxC;J
zmSz-<hGd%M9dd@_O+fB(xFA|4n;h$LF>E#v5fiZ3oI14i=rI(raXK_zZ6FM;cwn_9
zE_Q>|#WT~`#n~*yp|LT@WDgAq96)3ckHhX1Xpau<<fY+Sx{aeqCq&HFp>a|`#Auj>
z#Pe=|sO1`rRgh{VnvyFtDw3imB1%G`#R)C0P+<xUO%k+HiFkh~jOOOd^c?*(Z!CDF
zL#?9dqH#PgFHfGQlJjm0uAnFiCzQBSi9rM=<U2*igE@teZU#LNShvk3+IS}-F)}7T
zSJa_UX;%skmygydcx{4);U30?E98WfQa8|G_;;wo;X?~z!Xg;OtM`q>LR!8H;B$b$
z=ek*tun0KCknUg{>)Y$fb=x~L<yaipfdj$>C`{oC<+Ac3FIf4v<l%el%f>~=y8$Ee
z?lhjacNc0_HwzLUFBOJDBGPS6j?WV!B~jizK+lLkhbjpri4kf{rASkdw33V>R5U?!
z;S8`3I7VdN0m*YVbN+wg3<f&MDTs`d1xb1x3bn{>HjY*)R9aHa0nB7lm@x*BW{d(_
z6Q&`}8cGvQ0g}^pDuVm<Jew;SC++WQSdM2QhtC^2nj;hhL68_l01BfRiA`yW#z>8c
zi6&Kyier@BY$<LVd}kQ@>#UM04l+_4P-+#?W{lIQOqkM4sxhrX$zae>PD`37MrmeH
zgkxzl?{+Y-Lu?Ml0&thpf+BybiRbOS+rV?sYL(Q-kR4``XcJ)3^1W|HD#-D!>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Ygj_${)l6K3)9^%M)o-uBYj{bCCt=+H8rdFFZ`V@
Awg3PC

literal 0
HcmV?d00001

-- 
GitLab


From 1e791d6c85d9bb890a7c3b6450fc947e79336aa3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A3=D1=88=D0=BA=D0=BE=D0=B2=D0=B0=20=D0=94=D0=B8=D0=B0?=
 =?UTF-8?q?=D0=BD=D0=B0=20=D0=9F=D0=B5=D1=82=D1=80=D0=BE=D0=B2=D0=BD=D0=B0?=
 <dpushkova@edu.hse.ru>
Date: Thu, 6 Mar 2025 11:17:24 +0300
Subject: [PATCH 5/6] created texture for pacman and food

---
 .../application/BobBuilder/GameBuilders.cpp   |   5 +----
 .../application/Drawable/DrawMenu/Font/Font.h |   2 +-
 .../application/Drawable/Entity/IEntity.cpp   |  10 ++++------
 source/application/Drawable/Entity/IEntity.h  |   2 +-
 .../application/Drawable/Entity/MyTexture.cpp |   6 ++++--
 .../application/Drawable/Entity/MyTexture.h   |  17 +++++++++++------
 source/application/Drawable/Entity/Pacman.cpp |   5 ++---
 workdir/assets/apple.png                      | Bin 7216 -> 1211 bytes
 8 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/source/application/BobBuilder/GameBuilders.cpp b/source/application/BobBuilder/GameBuilders.cpp
index 3b89381..5afea2d 100644
--- a/source/application/BobBuilder/GameBuilders.cpp
+++ b/source/application/BobBuilder/GameBuilders.cpp
@@ -13,8 +13,6 @@ void CommonBuilder::create_context(float dynamic_objects_ratio) {
 
     float id = std::rand() % empty_rooms_buffer.size();
     //в рандомное место располагаем пакмана
-    m_context.m_pacman_texture = new PacmanTexture();
-    m_context.pacman.set_texture(m_context.m_pacman_texture);
     m_context.pacman.set_location(empty_rooms_buffer[id]);
     auto it = std::next(empty_rooms_buffer.begin(), id);
     empty_rooms_buffer.erase(it);
@@ -30,11 +28,10 @@ void CommonBuilder::create_context(float dynamic_objects_ratio) {
     }
 
     //располагаем еду
-    m_context.m_food_texture = new FoodTexture();
     for (auto it : empty_rooms_buffer) {
         auto food = std::make_unique<Food>();
         food->set_location(it);
-        food->set_texture(m_context.m_food_texture);
+        food->set_texture(&FoodTexture::instance());
         m_context.static_objects.emplace_back(std::move(food));
     }
     empty_rooms_buffer.clear();
diff --git a/source/application/Drawable/DrawMenu/Font/Font.h b/source/application/Drawable/DrawMenu/Font/Font.h
index 240f722..689eb11 100644
--- a/source/application/Drawable/DrawMenu/Font/Font.h
+++ b/source/application/Drawable/DrawMenu/Font/Font.h
@@ -7,7 +7,7 @@ public:
     MyFont(const MyFont&) = delete;
     MyFont& operator=(const MyFont&) = delete;
     static MyFont& Instance();
-    operator const sf::Font&() const; //@todo why is this necessary
+    operator const sf::Font&() const; //приведение типа
 
 private:
     MyFont();
diff --git a/source/application/Drawable/Entity/IEntity.cpp b/source/application/Drawable/Entity/IEntity.cpp
index 538e771..8bb10e2 100644
--- a/source/application/Drawable/Entity/IEntity.cpp
+++ b/source/application/Drawable/Entity/IEntity.cpp
@@ -9,6 +9,7 @@ void IEntity::set_location(Room* ptr_room) {
 Food::Food() {
     m_shape = sf::CircleShape(config::GAME_FOOD_SIZE/2);
     m_shape.setOrigin({ config::GAME_FOOD_SIZE/2, config::GAME_FOOD_SIZE/2 });
+    set_texture(&FoodTexture::instance());
     m_shape.setFillColor(config::GAME_FOOD_COLOR);
 }
 
@@ -17,11 +18,8 @@ std::unique_ptr<IStaticEntity> Food::clone() const {
 }
 
 void Food::prepare_for_drawing() {
-    if (m_ptr_texture)
-        m_sprite.setTexture(m_ptr_texture->get_texture());
-    else throw std::runtime_error("Can't load Food!");
-    m_shape.setPosition(m_ptr_room->get_position());
-    m_sprite.setPosition(m_ptr_room->get_position()+sf::Vector2f(-20, -20));
+    m_sprite.setTexture(m_ptr_texture->get_texture());
+    m_sprite.setPosition(m_ptr_room->get_position()+sf::Vector2f(-10, -10));
 }
 
 std::unique_ptr<IGameEvent> Enemy::accept(IVisitor* ptr_visitor) {
@@ -33,7 +31,7 @@ std::unique_ptr<IGameEvent> Food::accept(IVisitor* ptr_visitor) {
 }
 
 void Food::draw_into(sf::RenderWindow& window) {
-    m_shape.setPosition(m_ptr_room->get_position());
+    prepare_for_drawing();
     window.draw(m_sprite);
 }
 
diff --git a/source/application/Drawable/Entity/IEntity.h b/source/application/Drawable/Entity/IEntity.h
index 43a9788..f0348c7 100644
--- a/source/application/Drawable/Entity/IEntity.h
+++ b/source/application/Drawable/Entity/IEntity.h
@@ -67,6 +67,6 @@ public:
     ~Food() override {};
 private:
     sf::CircleShape m_shape;
+    MyTexture* m_ptr_texture;
     sf::Sprite m_sprite;
-    sf::Texture m_texture;
 };
\ No newline at end of file
diff --git a/source/application/Drawable/Entity/MyTexture.cpp b/source/application/Drawable/Entity/MyTexture.cpp
index a12402f..a7d4278 100644
--- a/source/application/Drawable/Entity/MyTexture.cpp
+++ b/source/application/Drawable/Entity/MyTexture.cpp
@@ -22,5 +22,7 @@ sf::Texture& PacmanTexture::get_texture() {
 }
 
 FoodTexture::FoodTexture() {
-    m_texture_food.loadFromFile(std::string(ASSETS_PATH) + "apple.png");
-}
\ No newline at end of file
+    if (!m_texture_food.loadFromFile(std::string(ASSETS_PATH) + "apple.png"))
+        throw std::runtime_error("Can't added Texture for food");
+}
+
diff --git a/source/application/Drawable/Entity/MyTexture.h b/source/application/Drawable/Entity/MyTexture.h
index bf7d051..4af54f3 100644
--- a/source/application/Drawable/Entity/MyTexture.h
+++ b/source/application/Drawable/Entity/MyTexture.h
@@ -4,9 +4,12 @@
 
 class MyTexture {
 public:
-    enum Direction {UP, DOWN, RIGHT, LEFT};
+    MyTexture() = default;
+    enum Direction { UP, DOWN, RIGHT, LEFT };
     virtual sf::Texture& get_texture() = 0;
-    void set_direction(Direction direction) {m_direction = direction;}
+    MyTexture(const MyTexture&) = delete;
+    MyTexture& operator=(const MyTexture&) = delete;
+    void set_direction(Direction direction) { m_direction = direction; }
 protected:
     Direction m_direction = UP;
 };
@@ -14,17 +17,19 @@ protected:
 //texture for Pacman
 class PacmanTexture : public MyTexture {
 public:
-    PacmanTexture();
+    static PacmanTexture& instance() { static PacmanTexture instance; return instance; }
     sf::Texture& get_texture() override;
 private:
+    PacmanTexture();
     sf::Texture m_texture_up, m_texture_down, m_texture_right, m_texture_left;
 };
 
 //texture for Food
 class FoodTexture : public MyTexture {
 public:
-    FoodTexture();
-    sf::Texture& get_texture() override {return m_texture_food;};
+    static FoodTexture& instance() { static FoodTexture instance; return instance; }
+    sf::Texture& get_texture() override { return m_texture_food; }
 private:
+    FoodTexture();
     sf::Texture m_texture_food;
-};
\ No newline at end of file
+};
diff --git a/source/application/Drawable/Entity/Pacman.cpp b/source/application/Drawable/Entity/Pacman.cpp
index fd04bc2..b47166f 100644
--- a/source/application/Drawable/Entity/Pacman.cpp
+++ b/source/application/Drawable/Entity/Pacman.cpp
@@ -4,6 +4,7 @@
 Pacman::Pacman() {
     m_shape = sf::CircleShape(config::GAME_PACMAN_SIZE);
     m_shape.setFillColor(config::GAME_COLOR_PACMAN);
+    set_texture(&PacmanTexture::instance());
     m_shape.setOrigin({config::GAME_PACMAN_SIZE, config::GAME_PACMAN_SIZE});
 }
 
@@ -13,9 +14,7 @@ void Pacman::move(Room::Direction direction) {
 }
 
 void Pacman::prepare_for_drawing() {
-    if (m_ptr_texture)
-        m_sprite.setTexture(m_ptr_texture->get_texture());
-    else throw std::runtime_error("Can't load Pacman!");
+    m_sprite.setTexture(m_ptr_texture->get_texture());
     m_sprite.setPosition(m_ptr_room->get_position()+sf::Vector2f(-20, -20));
 }
 
diff --git a/workdir/assets/apple.png b/workdir/assets/apple.png
index 3b35620e0afceae9e59995fcdc358ce3422112fb..bc27ccc400f05db3ddff79abddf562bfd8949f70 100644
GIT binary patch
literal 1211
zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc3?z4jzqJQa3dtTpz6=aiY77hwEes65fI<x~
z7#K<o7#Ln9FfdrnU|<k0n6oR;hJk_cVt`MGD^P)mfskH~mcukFr2zS$177mpvS(zJ
z9e8;>xO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aJo;rLacWjQizdJDYZRAWNc%BWpY_zQQKof?
zF1Oz3=vx@{h`DYd=+`JZzJm~mjViBqTDjc8C4DbE@^?XI|DQ@sDpwyMFEyG+%wAI6
P?g0>v$m10b=l=LF7&vF{

-- 
GitLab


From 6d80427668a627a970ae89983569ece68c27d1c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A3=D1=88=D0=BA=D0=BE=D0=B2=D0=B0=20=D0=94=D0=B8=D0=B0?=
 =?UTF-8?q?=D0=BD=D0=B0=20=D0=9F=D0=B5=D1=82=D1=80=D0=BE=D0=B2=D0=BD=D0=B0?=
 <dpushkova@edu.hse.ru>
Date: Thu, 6 Mar 2025 11:21:35 +0300
Subject: [PATCH 6/6] finish texture food and pacman

---
 source/main.cpp | 225 ------------------------------------------------
 1 file changed, 225 deletions(-)

diff --git a/source/main.cpp b/source/main.cpp
index 675d3f8..688c439 100644
--- a/source/main.cpp
+++ b/source/main.cpp
@@ -4,229 +4,4 @@ int main() {
     Application app;
     return app.run();
 }
-//
-//#include "ExperimentState.h"
-//#include <QTimer>
-//#include <QtCharts/QChart>
-//#include <QtCharts/QChartView>
-//#include <QtCharts/QLineSeries>
-//using namespace QtCharts;
-//#include <QtCore/QPointF>
-//#include <QtCharts/QValueAxis>
-//class RateLabel : public QWidget {
-//public:
-//    RateLabel(const QString& rate, QWidget* parent = nullptr) : QWidget(parent) {
-//        QHBoxLayout* layout = new QHBoxLayout(this);
-//        layout->setContentsMargins(0, 0, 0, 0); // Отступ слева
-//
-//        // Создаем метку с текстом
-//        QLabel* rateLabel = new QLabel(QString("\u03B5\u0307 = ") + rate); // Используем юникод для эпсилон с точкой
-//        rateLabel->setStyleSheet("color: #9E9E9E;"); // Цвет текста
-//        QFont font = rateLabel->font();
-//        font.setPointSize(16); // Размер шрифта
-//        rateLabel->setFont(font);
-//
-//        // Добавляем метку в макет
-//        layout->addWidget(rateLabel);
-//        layout->addStretch();
-//    }
-//};
-//
-//class CircleWidget: public QWidget {
-//    Q_OBJECT
-//public:
-//    explicit CircleWidget(QWidget* parent = nullptr) : QWidget(parent) {
-//        setFixedSize(30, 30);
-//    }
-//protected:
-//    void paintEvent(QPaintEvent* event) override {
-//        QPainter painter(this);
-//        int radius = width() /2;
-//        painter.drawEllipse((width()-radius)/2, (height()-radius)/2, radius, radius);
-//    }
-//};
-//class Progress: public QObject {
-//    Q_OBJECT
-//public:
-//    QHBoxLayout* progressBar() {
-//        m_progress = new QProgressBar;
-//        m_progress->setRange(0, 5);
-//        m_progress->setFixedWidth(300);
-//        m_progress->setFixedHeight(20);
-//        m_progress->setStyleSheet(
-//                "QProgressBar {"
-//                "    border: 1px solid grey;"
-//                "    border-radius: 10px;"
-//                "    background-color: #4A4849;"
-//                "    color: transparent;"
-//                "    font-weight: bold;"
-//                "}"
-//                "QProgressBar::chunk {"
-//                "    background-color: #52C7FA;"
-//                "    border-radius: 8px;"
-//                "}"
-//        );
-//        m_progress->setTextVisible(false);
-//        QHBoxLayout* phbxLayout = new QHBoxLayout;
-//        phbxLayout->addWidget(m_progress, 0, Qt::AlignLeft);
-//
-//        m_timer = new QTimer(this);
-//        connect(m_timer, &QTimer::timeout, this, &Progress::updateProgress); //запускаем каждую секунду
-//        return phbxLayout;
-//    }
-//
-//public slots:
-//    void updateProgress() {
-//        if (m_step < 5) {
-//            m_progress->setValue(++m_step);
-//        } else {
-//            m_timer->stop();
-//            emit progressFinished(); //сигнал, что закончили
-//        }
-//    }
-//
-//    void startProgress() {
-//        m_step = 0;
-//        m_progress->setValue(0);
-//        m_timer->start(1000); //обновление прогресса
-//    }
-//
-//    signals:
-//            void progressFinished();
-//
-//private:
-//    QProgressBar* m_progress;
-//    QTimer* m_timer;
-//    int m_step = 0;
-//};
-//
-//QHBoxLayout* ExperimentState::create_ui() {
-//    QHBoxLayout* mainLayout = new QHBoxLayout;
-//    QVBoxLayout* layout = new QVBoxLayout;
-//    QTableWidget* tbl = new QTableWidget(3, 4);
-//    QTableWidgetItem* ptwi = 0;
-//    QStringList lst, lst2;
-//    lst << "в„–1" << "в„–2" << "в„–3" << "+";
-//    lst2 << "Входные данные" << "Модель материала" << "Выходные кривые";
-//    tbl->setHorizontalHeaderLabels(lst);
-//    tbl->setVerticalHeaderLabels(lst2);
-//    tbl->setFixedSize(240, 110);
-//    tbl->setColumnWidth(0,30);
-//    tbl->setColumnWidth(1,30);
-//    tbl->setColumnWidth(2,30);
-//    tbl->setColumnWidth(3,30);
-//    tbl->setColumnWidth(4,30);
-//    tbl->setStyleSheet("QTableWidget::Item {border: 1px solid #5B5B5B;}");
-//    for (int row = 0; row < 3; row++) {
-//        for (int col = 0; col < 4; col++) {
-//            CircleWidget* circleWidget = new CircleWidget();
-//            tbl->setCellWidget(row, col, circleWidget);
-//        }
-//    }
-//    layout->addWidget(tbl);
-//    QLabel* text_status = new QLabel("Статус");
-//    text_status->setStyleSheet("color: #9E9E9E;");
-//    QFont font = text_status->font();
-//    font.setPointSize(16); //размер шрифта
-//    font.setBold(true); //жирный шрифт
-//    text_status->setFont(font);
-//    QLabel* tex_iter = new QLabel("Текущая итерация: 1");
-//    tex_iter->setStyleSheet("color: #9E9E9E;");
-//    QLabel* build_model = new QLabel("Построение модели материала");
-//    build_model->setStyleSheet("color: #9E9E9E;");
-//    QLabel* build_mke = new QLabel("Конечно элементное моделирование");
-//    build_mke->setStyleSheet("color: #9E9E9E;");
-//
-//    Progress* prog1 = new Progress;
-//    Progress* prog2 = new Progress;
-//    QLabel* text = new QLabel("Просмотр моделирования");
-//    text->setStyleSheet("color: #9E9E9E;");
-//    QFont font2 = text->font();
-//    font2.setPointSize(16); //размер шрифта
-//    font2.setBold(true); //жирный шрифт
-//    text->setFont(font2);
-//
-//    QComboBox* cbo = new QComboBox;
-//    QStringList list;
-//    list << "Итерация №1" << "Итерация №2" << "Итерация №3";
-//    cbo->addItems(list);
-//    cbo->setEditable(true);
-//    cbo->setFixedWidth(130);
-//    QWidget* rateButtonsWidget = new QWidget;
-//    QGridLayout* gridLayout = new QGridLayout(rateButtonsWidget);
-//    gridLayout->setSpacing(5);
-//    gridLayout->addWidget(new RateLabel("0.002"), 0, 0);
-//    gridLayout->addWidget(new RateLabel("0.03"), 0, 1);
-//    gridLayout->addWidget(new RateLabel("0.005"), 1, 0);
-//    gridLayout->addWidget(new RateLabel("0.05"), 1, 1);
-//    gridLayout->addWidget(new RateLabel("0.01"), 2, 0);
-//
-//    layout->addWidget(text_status);
-//    layout->addWidget(tex_iter);
-//    layout->addWidget(build_model);
-//    layout->addLayout(prog1->progressBar());
-//    layout->addWidget(build_mke);
-//    layout->addLayout(prog2->progressBar());
-//    prog1->startProgress();
-//    layout->addWidget(text);
-//    layout->addWidget(cbo);
-//    layout->addWidget(rateButtonsWidget);
-//    mainLayout->addLayout(layout);
-//    // Создаём представление для графика
-//    QChart *chart = new QChart();
-//    chart->setTitleBrush(QBrush(Qt::white));
-//    chart->legend()->hide();
-//
-//    QLineSeries *series1 = new QLineSeries();
-//    series1->append(0.0, 3.0);
-//    series1->append(0.1, 4.0);
-//    series1->append(0.2, 5.5);
-//    series1->append(0.3, 8.2);
-//    series1->append(0.4, 9.8);
-//    series1->append(0.5, 10.2);
-//    series1->append(0.6, 10.0);
-//    series1->append(0.7, 11.4);
-//    series1->append(0.8, 12.4);
-//    series1->append(0.9, 11.8);
-//    series1->append(1.0, 10.5);
-//    QPen pen1(QColor(135, 206, 235));
-//    pen1.setWidth(2);
-//    pen1.setStyle(Qt::PenStyle::DashLine);
-//    series1->setPen(pen1);
-//    chart->addSeries(series1);
-//
-//    QValueAxis* axisX = new QValueAxis();
-//    axisX->setRange(0.0, 1.1);
-//    axisX->setLabelFormat("%.1f");
-//    axisX->setTickCount(12);
-//    axisX->setLabelsColor(QColor(158, 158, 158));
-//    axisX->setTitleText("Деформация, -");
-//    axisX->setTitleBrush(QColor(158, 158, 158));
-//    axisX->setGridLineColor(QColor(158, 158, 158));
-//    chart->addAxis(axisX, Qt::AlignBottom);
-//    series1->attachAxis(axisX);
-//
-//    chart->setBackgroundBrush(Qt::transparent);
-//    chart->setPlotAreaBackgroundBrush(Qt::transparent);
-//    chart->setPlotAreaBackgroundVisible(true);
-//
-//    QValueAxis *axisY = new QValueAxis();
-//    axisY->setRange(0.0, 15.0);
-//    axisY->setTickCount(9);
-//    axisY->setLabelFormat("%.0f");
-//    axisY->setLabelsColor(QColor(158, 158, 158));
-//    axisY->setTitleText("Напряжение, МPa");
-//    axisY->setTitleBrush(QColor(158, 158, 158));
-//    axisY->setGridLineColor(QColor(158, 158, 158));
-//    chart->addAxis(axisY, Qt::AlignLeft);
-//    series1->attachAxis(axisY);
-//    QChartView *chartView = new QChartView(chart);
-////    chartView->setRenderHint(QPainter::Antialiasing);
-//    chartView->setMinimumSize(500, 350);
-//    chartView->setStyleSheet("background-color: transparent;");
-//    mainLayout->addWidget(chartView);
-//    connect(prog1, &Progress::progressFinished, [prog2]() {prog2->startProgress();});
-//    return mainLayout;
-//}
-//#include "ExperimentState.moc"
 
-- 
GitLab