bubbletwist/lib/game/stone/triple_special_stone.dart

26 lines
1015 B
Dart

import 'package:bubbletwist/game/stone/stone_location.dart';
import 'package:bubbletwist/game/stone/triggerable_special_stone.dart';
class TripleSpecialStone extends TriggerableSpecialStone {
TripleSpecialStone(super.board);
@override
int getSpecialStoneNumber() {
return 3;
}
@override
void performSpecialStoneAction() {
// remove stone checks the array bounds
board.removeStone(StoneLocation(row: row + 1, column: column));
board.removeStone(StoneLocation(row: row + 1, column: column + 1));
board.removeStone(StoneLocation(row: row + 1, column: column - 1));
board.removeStone(StoneLocation(row: row, column: column));
board.removeStone(StoneLocation(row: row, column: column + 1));
board.removeStone(StoneLocation(row: row, column: column - 1));
board.removeStone(StoneLocation(row: row - 1, column: column));
board.removeStone(StoneLocation(row: row - 1, column: column + 1));
board.removeStone(StoneLocation(row: row - 1, column: column - 1));
}
}