mirror of
https://github.com/zhenyan121/SporeBG-Conid.git
synced 2026-04-10 06:14:08 +08:00
Modified the rule to only allow moves for selected piece
This commit is contained in:
@@ -106,11 +106,10 @@ bool Rule::canSpore(const Board* board, const int fromRow, const int fromCol, co
|
||||
int toPieceID = board->getPieceID(toRow, toCol);
|
||||
auto selectedComponent = board->getComponentByPieceID(fromPieceID);
|
||||
std::cout << "before action Component size: " << selectedComponent.size() << "\n";
|
||||
for (auto PieceID : selectedComponent) {
|
||||
auto SporeRegion = board->getSporeRange(PieceID);
|
||||
if (SporeRegion.find(toPieceID) != SporeRegion.end()) {
|
||||
return true;
|
||||
}
|
||||
auto SporeRegion = board->getSporeRange(fromPieceID);
|
||||
if (SporeRegion.find(toPieceID) != SporeRegion.end()) {
|
||||
return true;
|
||||
|
||||
}
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user