diff --git a/CMakeLists.txt b/CMakeLists.txt index 49112ee..74d79e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,8 @@ project(ProtocolDeveloppement) set(CMAKE_CXX_STANDARD 14) -set(CMAKE_PREFIX_PATH "/Qt/6.5.0/android_arm64_v8a/lib/cmake") +#set(CMAKE_PREFIX_PATH "/Qt/6.5.0/android_arm64_v8a/lib/cmake") +set(CMAKE_PREFIX_PATH "D:/programme/Qt/6.5.0/mingw_64/lib/cmake") find_package(Qt6Widgets REQUIRED) @@ -13,6 +14,8 @@ find_package(Qt6Gui REQUIRED) add_executable(${PROJECT_NAME} main.cpp stompframe.cpp + stomp.cpp + app.cpp ) link_directories( ${PCL_LIBRARY_DIRS} ) diff --git a/app.cpp b/app.cpp index cbbb67b..ec96429 100644 --- a/app.cpp +++ b/app.cpp @@ -25,6 +25,7 @@ void App::receiveIndication(int id, QString destination, QString body) { if(destination.contains("field")){ fillField(body); } + computeMove(); } void App::disconnectConfirmation() { @@ -40,26 +41,51 @@ void App::addGem(int x, int y, int pts) { g.x = x; g.y = y; g.pts = pts; + g.relativePts = computeRelativePts(g); gems_.append(g); } +void App::printGem() { + for (Gem g: gems_) { + qDebug() << g.x << ":" << g.y << " - " << g.pts << Qt::endl; + } +} + void App::fillField(QString body) { - static int x = 0; - static int y = 0; + int x = 0; + int y = 0; + gems_.clear(); for(int i = 0; i