Removed lots of slack, edited map functions into dispatcher, puzzleMat missing

Removed overconstructed logic, changed vector to map. PuzzleMat object not defined yet, for implementation, make the functions that have already been called through it.
This commit is contained in:
Raphael Maenle
2017-12-20 18:23:39 +01:00
parent c885e472fb
commit ce5e007bc7
5 changed files with 53 additions and 497 deletions

View File

@ -40,6 +40,7 @@ bool AbstractionLayer_1::CreateRandomPuzzle()
for(int col=1;col<m_constraintMatrix.size()-1;col++){
for(int row=1;row<m_constraintMatrix[col].size()-1;)
{
//create random piece
uint8_t tempPiece = 0b00000000;
if(simple_rand()%2)
tempPiece|=0b01000000;
@ -61,6 +62,17 @@ bool AbstractionLayer_1::CreateRandomPuzzle()
else
tempPiece|=0b00000010;
//set edges and corners to 00
if(row==1)
tempPiece and_eq (uint8_t)0b00111111;
if(row==m_constraintMatrix[col].size())
tempPiece and_eq (uint8_t)0b11110011;
if(col==1)
tempPiece and_eq (uint8_t)0b11111100;
if(col==m_constraintMatrix.size()-1)
tempPiece and_eq (uint8_t)0b11001111;
//set piece if piece good
if(PlaceOfPartGood(coor(col,row),tempPiece))
row++;
}