diff --git a/AI/src/game/penguin.cpp b/AI/src/game/penguin.cpp index bec187b7c7128786b04cb00915767472479a1152..180ab435bfbfc70f17b5f2dfd8e15b6574663f3c 100644 --- a/AI/src/game/penguin.cpp +++ b/AI/src/game/penguin.cpp @@ -280,37 +280,36 @@ namespace game } // ADD PENGUIN TILE TO THE SCORE - - /* - //TODO: implements methods with arrays - if ((state.one_fish >> position) & 1) + #define POS(penguin) ((penguin) & 63) + if((state.one_fish >> POS(*peng)) & 1) //If there is a one fish on this position { - if(current_player() == RED) + if(state.current_player_red) state.score_red += 1; else state.score_blue += 1; //We replace this tile with an empty one (0 in the bitboard) - state.one_fish = state.one_fish & ~(((uint64_t) 1) << position); + state.one_fish = state.one_fish & ~(((uint64_t) 1) << POS(*peng)); } - else if ((state.two_fish >> position) & 1) + else if((state.two_fish >> POS(*peng)) & 1) { - - if(current_player() == RED) + if(state.current_player_red) state.score_red += 2; else state.score_blue += 2; //We replace this tile with an empty one (0 in the bitboard) - state.two_fish = state.two_fish & ~(((uint64_t) 1) << position); + state.two_fish = state.two_fish & ~(((uint64_t) 1) << POS(*peng)); } else { - if(current_player() == RED) + if(state.current_player_red) state.score_red += 3; else state.score_blue += 3; //We replace this tile with an empty one (0 in the bitboard) - state.three_fish = state.three_fish & ~(((uint64_t) 1) << position); + state.one_fish = state.one_fish & ~(((uint64_t) 1) << POS(*peng)); } + /* + //TODO: implements methods with arrays //Move the current penguin move_penguin(p);