public class BitboardAttacks extends Object
Modifier and Type | Field and Description |
---|---|
static long[][] |
bishopMagic |
static byte[] |
bishopShiftBits |
static boolean |
initialized |
static long[] |
king |
static long[] |
knight |
static long[] |
pawnDownwards |
static long[] |
pawnUpwards |
static byte[] |
rookShiftBits |
Constructor and Description |
---|
BitboardAttacks() |
Modifier and Type | Method and Description |
---|---|
static void |
generateAttacks() |
static long |
generatePieces(int index,
int bits,
long mask)
Fills pieces from a mask.
|
static long |
getBishopAttacks(int index,
long all) |
static long |
getBishopShiftAttacks(long square,
long all) |
static long |
getIndexAttacks(com.alonsoruibal.chess.Board board,
int index)
Discover attacks to squares using magics: cheap version
|
static long |
getRookAttacks(int index,
long all)
Magic! attacks, very fast method
|
static long |
getRookShiftAttacks(long square,
long all)
without magic bitboards, too expensive, but neccesary for magic generation
|
static long |
getXrayAttacks(com.alonsoruibal.chess.Board board,
int index,
long all) |
static void |
init()
Build/load attack tables
|
static boolean |
isIndexAttacked(com.alonsoruibal.chess.Board board,
byte index,
boolean white)
Discover attacks to squares using magics: cheap version
|
static boolean |
isSquareAttacked(com.alonsoruibal.chess.Board board,
long square,
boolean white)
Discover attacks to squares using magics: expensive version
|
static int |
magicTransform(long b,
long magic,
byte bits) |
public static boolean initialized
public static final byte[] rookShiftBits
public static final byte[] bishopShiftBits
public static long[][] bishopMagic
public static long[] knight
public static long[] king
public static long[] pawnDownwards
public static long[] pawnUpwards
public static void generateAttacks()
public static void init()
public static boolean isSquareAttacked(com.alonsoruibal.chess.Board board, long square, boolean white)
public static boolean isIndexAttacked(com.alonsoruibal.chess.Board board, byte index, boolean white)
public static long getIndexAttacks(com.alonsoruibal.chess.Board board, int index)
public static long getXrayAttacks(com.alonsoruibal.chess.Board board, int index, long all)
public static long getRookAttacks(int index, long all)
public static long getBishopAttacks(int index, long all)
public static int magicTransform(long b, long magic, byte bits)
public static long generatePieces(int index, int bits, long mask)
public static long getRookShiftAttacks(long square, long all)
public static long getBishopShiftAttacks(long square, long all)
Copyright © 2017. All Rights Reserved.