Commit c6af497f authored by Emil's avatar Emil

Fix to next_pos

parent 238cacdd
......@@ -37,49 +37,49 @@ namespace gameengine::utility
}
case MoveDirection::S: //new position when moving South
if (board_pos.value()>55) {
if (board_pos.value()<8) {
}
else {
return gameengine::BitPos(board_pos.value()-8);
}
case MoveDirection::E: //new position when moving East
if (board_pos.value()>55) {
if (board_pos.value()%8>6) {
}
else {
return gameengine::BitPos(board_pos.value()+1);
}
case MoveDirection::W: //new position when moving West
if (board_pos.value()>55) {
if (board_pos.value()%8<1) {
}
else {
return gameengine::BitPos(board_pos.value()-1);
}
case MoveDirection::SE: //new position when moving South_East
if (board_pos.value()>55) {
if (board_pos.value()<8 && board_pos.value()%8>6) {
}
else {
return gameengine::BitPos(board_pos.value()-7);
}
case MoveDirection::SW: //new position when moving South-West
if (board_pos.value()>55) {
if (board_pos.value()<8 && board_pos.value()%8<1) {
}
else {
return gameengine::BitPos(board_pos.value()-9);
}
case MoveDirection::NE: //new position when moving North-East
if (board_pos.value()>55) {
if (board_pos.value()>55 && board_pos.value()%8>6) {
}
else {
return gameengine::BitPos(board_pos.value()+9);
}
case MoveDirection::NW: //new position when moving North-West
if (board_pos.value()>55) {
if (board_pos.value()>55 && board_pos.value()%8<1) {
}
else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment