Example #1
0
def _pycall_path_swap_src_dest(x1: int, y1: int, x2: int, y2: int,
                               handle: Any) -> float:
    """A TDL function dest comes first to match up with a dest only call."""
    return ffi.from_handle(handle)(x2, y2, x1, y1)  # type: ignore
Example #2
0
def _pycall_path_dest_only(x1: int, y1: int, x2: int, y2: int,
                           handle: Any) -> float:
    """A TDL function which samples the dest coordinate only."""
    return ffi.from_handle(handle)(x2, y2)  # type: ignore
Example #3
0
def _pycall_path_old(x1: int, y1: int, x2: int, y2: int, handle: Any) -> float:
    """libtcodpy style callback, needs to preserve the old userData issue."""
    func, userData = ffi.from_handle(handle)
    return func(x1, y1, x2, y2, userData)  # type: ignore
Example #4
0
def _pycall_path_simple(x1: int, y1: int, x2: int, y2: int,
                        handle: Any) -> float:
    """Does less and should run faster, just calls the handle function."""
    return ffi.from_handle(handle)(x1, y1, x2, y2)  # type: ignore
Example #5
0
def _pycall_path_swap_src_dest(x1, y1, x2, y2, handle):
    # type: (int, int, int, int, cffi.CData]) -> float
    """A TDL function dest comes first to match up with a dest only call."""
    return ffi.from_handle(handle)(x2, y2, x1, y1)
Example #6
0
def _pycall_path_dest_only(x1, y1, x2, y2, handle):
    # type: (int, int, int, int, cffi.CData]) -> float
    """A TDL function which samples the dest coordinate only."""
    return ffi.from_handle(handle)(x2, y2)
Example #7
0
def _pycall_path_simple(x1, y1, x2, y2, handle):
    # type: (int, int, int, int, cffi.CData]) -> float
    """Does less and should run faster, just calls the handle function."""
    return ffi.from_handle(handle)(x1, y1, x2, y2)
Example #8
0
def _pycall_path_old(x1, y1, x2, y2, handle):
    # type: (int, int, int, int, cffi.CData]) -> float
    """libtcodpy style callback, needs to preserve the old userData issue."""
    func, userData = ffi.from_handle(handle)
    return func(x1, y1, x2, y2, userData)
Example #9
0
def _pycall_path_dest_only(x1, y1, x2, y2, handle):
    """A TDL function which samples the dest coordinate only."""
    return ffi.from_handle(handle)(x2, y2)
Example #10
0
def _pycall_path_swap_src_dest(x1, y1, x2, y2, handle):
    """A TDL function dest comes first to match up with a dest only call."""
    return ffi.from_handle(handle)(x2, y2, x1, y1)
Example #11
0
def _pycall_path_simple(x1, y1, x2, y2, handle):
    """Does less and should run faster, just calls the handle function."""
    return ffi.from_handle(handle)(x1, y1, x2, y2)