diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index ef2e6ee..efd787f 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -10,6 +10,7 @@ set(SOURCE_FILES functions/solve/classExtension.cpp functions/solve/structure.cpp functions/AbstractionLayers/AbstraktionLayer_Base.h + functions/AbstractionLayers/DestructionPower/DestructionPower.cpp ) add_executable(PuzzleSolver ${SOURCE_FILES}) include_directories(${OpenCV_INCLUDE_DIRS}) diff --git a/Source/functions/AbstractionLayers/DestructionPower/DestructionPower.h b/Source/functions/AbstractionLayers/DestructionPower/DestructionPower.h index 09f585f..b5bfbe1 100644 --- a/Source/functions/AbstractionLayers/DestructionPower/DestructionPower.h +++ b/Source/functions/AbstractionLayers/DestructionPower/DestructionPower.h @@ -9,7 +9,6 @@ #define DESTRUCTION_COUNT 1 #include "../AbstraktionLayer_Base.h" -#include "DestructionPower_Properties.h" #include #include #include diff --git a/Source/functions/AbstractionLayers/DestructionPower/DestructionPower_Properties.h b/Source/functions/AbstractionLayers/DestructionPower/DestructionPower_Properties.h index fd5f758..d6f9af6 100644 --- a/Source/functions/AbstractionLayers/DestructionPower/DestructionPower_Properties.h +++ b/Source/functions/AbstractionLayers/DestructionPower/DestructionPower_Properties.h @@ -5,8 +5,6 @@ #ifndef SOURCE_DESTRUCTIONPOWER_PROPERTIES_H #define SOURCE_DESTRUCTIONPOWER_PROPERTIES_H - - #include #include "DestructionPower.h" @@ -15,21 +13,35 @@ class DestructionPower_Properties public: DestructionPower_Properties() { - for(int i=0;i getSpeedTable() + { + return SpeedTable; + } + void setSpeedTable() + { SpeedTable=create_SpeedTable();} + private: + + static map create_SpeedTable(); + static map SpeedTable; + float DestructionArray[DESTRUCTION_COUNT]; - static map SpeedTable = create_SpeedTable; + friend class DestructionPower; - static map create_SpeedTable(){ - map m; - m[1] = 0.001; - return m; - } }; +map DestructionPower_Properties::create_SpeedTable() +{ + map m; + m[1] = 0.001; + return m; +} #endif //SOURCE_ABSTRACTIONLAYER_1_PROPERTIES_H diff --git a/Source/functions/AbstractionLayers/Layer1/AbstractionLayer_1.h b/Source/functions/AbstractionLayers/Layer1/AbstractionLayer_1.h index dc04ead..9a5c193 100644 --- a/Source/functions/AbstractionLayers/Layer1/AbstractionLayer_1.h +++ b/Source/functions/AbstractionLayers/Layer1/AbstractionLayer_1.h @@ -6,7 +6,6 @@ #define SOURCE_ABSTRACTIONLAYER_1_H #include "../AbstraktionLayer_Base.h" -#include "AbstractionLayer_1_Properties.h" #include #include #include diff --git a/Source/header.h b/Source/header.h index 3146629..73c6149 100755 --- a/Source/header.h +++ b/Source/header.h @@ -11,9 +11,5 @@ using namespace std; -/** - * IMPORTANT: Each new layer must be included there, to avoid compile errors - */ -#include "functions/AbstractionLayers/Layer1/AbstractionLayer_1.cpp" - +#include "header/input.h" #include "header/solve.h" diff --git a/Source/header/input.h b/Source/header/input.h index 3db8cc7..3ae14d7 100755 --- a/Source/header/input.h +++ b/Source/header/input.h @@ -1,9 +1,7 @@ -#ifndef SOURCE_PART_H -#define SOURCE_PART_H - #include -#include "../functions/AbstractionLayers/Layer1/AbstractionLayer_1_Properties.h" -#include "../functions/AbstractionLayers/DestructionPower/DestructionPower_Properties.h" + +class AbstractionLayer_1_Properties; +class DestructionPower_Properties; class Part { public: @@ -37,5 +35,3 @@ private: int32_t m_partID; uint8_t m_numOfRotations; }; - -#endif //SOURCE_PART_H \ No newline at end of file diff --git a/Source/header/solve.h b/Source/header/solve.h index ab722ff..b6532a3 100755 --- a/Source/header/solve.h +++ b/Source/header/solve.h @@ -3,7 +3,6 @@ #include #include -#include "input.h" #include #include