static BishopMoveTable() { var magicFinder = new MagicFinder(new MTRandom(0)); MagicMoveTableBuilder builder = new MagicMoveTableBuilder(magicFinder); foreach (var(file, rank) in Position.GetAllFilesRanks()) { AddMovesFromSquare(builder, file, rank); } BishopMoveMagicTable = builder.Build(); }
static PawnDoubleMoveTable() { DoubleMovesMagicTables = new MagicMoveTable[2]; var magicFinder = new MagicFinder(new MTRandom(0)); foreach (var color in new[] { Color.White, Color.Black }) { MagicMoveTableBuilder builder = new MagicMoveTableBuilder(magicFinder); foreach (var(file, rank) in Position.GetAllFilesRanks()) { AddMovesFromSquare(builder, file, rank, color); } DoubleMovesMagicTables[(int)color] = builder.Build(); } }