+
+ isAttackedByPawn([x,y], colors)
+ {
+ for (let c of colors)
+ {
+ let pawnShift = (c=="w" ? 1 : -1);
+ if (x+pawnShift>=0 && x+pawnShift<V.size.x)
+ {
+ if (this.getPiece(x+pawnShift,y)==V.PAWN && this.getColor(x+pawnShift,y)==c)
+ return true;
+ }
+ }
+ return false;
+ }