Add python c binding class interface #29

Merged
Josh merged 10 commits from 28-move-bindings-to-class into main 2025-08-22 19:28:03 +00:00
Showing only changes of commit 8ef4a48ddc - Show all commits

View File

@@ -127,20 +127,20 @@ class ChessFFI:
def gen_pseudo_moves(self, board, captures_only=False, cap=256):
buf = (Move * cap)()
n = self._c_gen_pseudo_moves(C.byref(board), buf, captures_only)
n = self._c_gen_pseudo_moves(board, buf, captures_only)
return buf, n
def get_legal_moves(self, board, out):
return int(self._c_get_legal_moves(board, out))
return self._c_get_legal_moves(board, out)
def square_attacked(self, board, sq, by):
return bool(self._c_square_attacked(C.byref(board), int(sq), int(by)))
return self._c_square_attacked(board, sq, by)
def in_check(self, board, side):
return bool(self._c_in_check(C.byref(board), int(side)))
return self._c_in_check(board, side)
def attackers_to(self, board, sq, by):