Commit 4c4ad0f5 authored by Emil's avatar Emil

Update to utility (normal moves vorking, not jumps)

parent e0eaa84d
......@@ -103,24 +103,30 @@ namespace gameengine::utility
Moves new_moves{};
Moves new_jumps{};
BitPieces East;
BitPieces East_jump1;
BitPieces East_jump;
BitPieces West;
BitPieces West_jump;
BitPieces West_jump1;
BitPieces mask = MaskCheck;
BitPieces unoccupied = ~occupiedPositions(board);
// Masks for player One (simple moves and jumps)
// Masks for player One (simple moves and jumps (north))
if (player_id == PlayerId::One) {
East = (unoccupied & MaskEast)>>9 & occupiedPosition(board,player_id);
East_jump = ((unoccupied & MaskEast)>>9 & occupiedPosition(board,PlayerId::Two)) & (((((unoccupied & MaskEast)>>9) & occupiedPosition(board,PlayerId::Two))>>9) & occupiedPosition(board,player_id));
East_jump1 = ((unoccupied & MaskEast)>>9);
East_jump = ((East_jump1 & (occupiedPosition(board,PlayerId::Two)))>>9) & occupiedPosition(board,player_id);
West = (unoccupied & MaskWest)>>7 & occupiedPosition(board,player_id);
West_jump = ((unoccupied & MaskWest)>>7 & occupiedPosition(board,PlayerId::Two)) & (((((unoccupied & MaskWest)>>7) & occupiedPosition(board,PlayerId::Two))>>7) & occupiedPosition(board,player_id));
West_jump1 = ((unoccupied & MaskWest)>>7);
West_jump = ((West_jump1 & (occupiedPosition(board,PlayerId::Two)))>>7) & occupiedPosition(board,player_id);
}
// Masks for player Two (simple moves and jumps)
// Masks for player Two (simple moves and jumps (south))
else {
East = (unoccupied & MaskEast)<<7 & occupiedPosition(board,player_id);
East_jump = ((unoccupied & MaskEast)<<7 & occupiedPosition(board,PlayerId::One)) & (((((unoccupied & MaskEast)<<7) & occupiedPosition(board,PlayerId::One))<<7) & occupiedPosition(board,player_id));
East_jump1 = ((unoccupied & MaskEast)<<7);
East_jump = ((East_jump1 & (occupiedPosition(board,PlayerId::One)))<<7) & occupiedPosition(board,player_id);
West = (unoccupied & MaskWest)<<9 & occupiedPosition(board,player_id);
West_jump = ((unoccupied & MaskWest)<<9 & occupiedPosition(board,PlayerId::One)) & (((((unoccupied & MaskWest)<<9) & occupiedPosition(board,PlayerId::One))<<9) & occupiedPosition(board,player_id));
West_jump1 = ((unoccupied & MaskWest)<<9);
West_jump = ((West_jump1 & (occupiedPosition(board,PlayerId::One)))<<9) & occupiedPosition(board,player_id);
}
// if there is no jumps, then simple moves are legal
if (East_jump.none() && West_jump.none()){
......
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