Exemplo n.º 1
0
        private unsafe void HalfKpAppendActiveIndices(NnuePosition pos, int c, ref IndexList2 active)
        {
            int ksq = pos.Squares[c];

            ksq = orient(c, ksq);
            for (int i = 2; pos.Pieces[i] != 0; i++)
            {
                int sq = pos.Squares[i];
                int pc = pos.Pieces[i];
                active.values[active.size++] = make_index(c, sq, pc, ksq);
            }
        }
Exemplo n.º 2
0
        private unsafe void HaldKpAppendChangedIndices(NnuePosition pos, byte color, NnueDirtyPiece dirtyPiece, ref IndexList2 removed, ref IndexList2 added)
        {
            int ksq = pos.Squares[color];

            ksq = orient(color, ksq);
            for (int i = 0; i < dirtyPiece.dirtyNum; i++)
            {
                var pc = dirtyPiece.pc[i];
                if (IsKing(pc))
                {
                    continue;
                }

                if (dirtyPiece.from[i] != 64)
                {
                    removed.values[removed.size++] = make_index(color, dirtyPiece.from[i], pc, ksq);
                }

                if (dirtyPiece.to[i] != 64)
                {
                    added.values[added.size++] = make_index(color, dirtyPiece.to[i], pc, ksq);
                }
            }
        }