Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
CMakeUserPresets.json
25 changes: 25 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
cmake_minimum_required(VERSION 3.10)

# Project name and version
project(LabiryntGenerator VERSION 1.1)

# Specify the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# Add subdirectories for each module
add_subdirectory(Logs)
add_subdirectory(DrawingEngine)
add_subdirectory(Cli)
add_subdirectory(ClassFactory)
add_subdirectory(DrawingEngineFactory)

# Create the main executable
add_executable(LabiryntGenerator main.cpp)

# Find the FTXUI package
find_package(ftxui REQUIRED)

# Link the modules and FTXUI to the main executable
target_link_libraries(LabiryntGenerator PRIVATE Logs DrawingEngine Cli ClassFactory DrawingEngineFactory ftxui::ftxui)

20 changes: 20 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <iostream>
#include "./DrawingEngineFactory/DrawingEngineFactory.h"
#include "./Logs/Logs.h"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relative paths

#include <memory>
#include <vector>

using namespace std;

int main(){
writeToLogs("App start");
//creating drawing engine factory with specific style of drawing
DrawingEngineFactory def = DrawingEngineFactory(0);
//creating drawing engine and taking poiter to it
shared_ptr<DrawingEngine> engine = def.createEngine(3,4, 'r', 'w');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the way you defined drawing engine constructor will not make sense for FTXUI, also it will be hard to extend for borders or any other thing you would might like to add

//creating vector of vector of integers to print
vector<vector<int>> toPrint ({{0, 1, 1}, {1 , 0, 1}, {1, 0, 1}, {1, 0, 0}});
//printing
(*engine).print(toPrint);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

engine->print(toPrint) ...

return 0;
}