edited destructionLayer, changed includes

This commit is contained in:
Raphael Maenle 2017-12-20 23:01:04 +01:00
parent e641199ce4
commit 37eed7ef88
7 changed files with 27 additions and 25 deletions

View File

@ -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})

View File

@ -9,7 +9,6 @@
#define DESTRUCTION_COUNT 1
#include "../AbstraktionLayer_Base.h"
#include "DestructionPower_Properties.h"
#include <vector>
#include <iostream>
#include <bitset>

View File

@ -5,8 +5,6 @@
#ifndef SOURCE_DESTRUCTIONPOWER_PROPERTIES_H
#define SOURCE_DESTRUCTIONPOWER_PROPERTIES_H
#include <stdint.h>
#include "DestructionPower.h"
@ -15,21 +13,35 @@ class DestructionPower_Properties
public:
DestructionPower_Properties()
{
for(int i=0;i<DestructionArray.size();i++)
DestructionArray[i]=(map[i]*DESTRUCTION_INIT);
for(int i=0;i<sizeof(DestructionArray);i++)
DestructionArray[i]=(SpeedTable[i]*DESTRUCTION_INIT);
setSpeedTable();
}
map<int,float> getSpeedTable()
{
return SpeedTable;
}
void setSpeedTable()
{ SpeedTable=create_SpeedTable();}
private:
static map<int,float> create_SpeedTable();
static map<int,float> SpeedTable;
float DestructionArray[DESTRUCTION_COUNT];
static map<int,float> SpeedTable = create_SpeedTable;
friend class DestructionPower;
static map<int,float> create_SpeedTable(){
};
map<int,float> DestructionPower_Properties::create_SpeedTable()
{
map<int, float> m;
m[1] = 0.001;
return m;
}
};
#endif //SOURCE_ABSTRACTIONLAYER_1_PROPERTIES_H

View File

@ -6,7 +6,6 @@
#define SOURCE_ABSTRACTIONLAYER_1_H
#include "../AbstraktionLayer_Base.h"
#include "AbstractionLayer_1_Properties.h"
#include <vector>
#include <iostream>
#include <bitset>

View File

@ -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"

View File

@ -1,9 +1,7 @@
#ifndef SOURCE_PART_H
#define SOURCE_PART_H
#include <stdint.h>
#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

View File

@ -3,7 +3,6 @@
#include <vector>
#include <iostream>
#include "input.h"
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>