-
Notifications
You must be signed in to change notification settings - Fork 3
/
path.rkt
41 lines (34 loc) · 1.77 KB
/
path.rkt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#lang racket
(require ffi/unsafe
"loader.rkt"
"fov.rkt")
(define _map-path (_cpointer/null "tcod-path"))
; float (*TCOD_path_func_t)( int xFrom, int yFrom, int xTo, int yTo, void *user_data );
(define _path-function (_fun _int _int _int _int _pointer -> _float))
; TCOD_path_t TCOD_path_new_using_map(TCOD_map_t map, float diagonalCost);
(deftcod path-new-using-map : _map _float -> _map-path)
(deftcod path-new-using-function : _int _int _path-function _float -> _map-path)
(deftcod path-compute : _map-path _int _int _int _int -> _bool)
(deftcod path-walk : _map-path (x : (_ptr o _int)) (y : (_ptr o _int)) _bool -> (r : _bool) ->
(values r (cons x y)))
(deftcod path-is-empty? : _map-path -> _bool)
(deftcod path-size : _map-path -> _int)
(deftcod path-reverse : _map-path -> _void)
(deftcod path-get : _map-path _int (x : (_ptr o _int)) (y : (_ptr o _int)) -> _void ->
(cons x y))
(deftcod path-get-origin : _map-path (x : (_ptr o _int)) (y : (_ptr o _int)) -> _void ->
(cons x y))
(deftcod path-get-destination : _map-path (x : (_ptr o _int)) (y : (_ptr o _int)) -> _void ->
(cons x y))
(deftcod path-delete : _map-path -> _void)
(define _dijkstra-path (_cpointer/null "tcod-dijkstra"))
(deftcod dijkstra-new : _map _float -> _dijkstra-path)
(deftcod dijkstra-compute : _dijkstra-path _int _int -> _void)
(deftcod dijkstra-get-distance : _dijkstra-path _int _int -> _float)
(deftcod dijkstra-path-set : _dijkstra-path _int _int -> _void)
(deftcod dijkstra-is-empty? : _dijkstra-path -> _bool)
(deftcod dijkstra-size : _dijkstra-path -> _int)
(deftcod dijkstra-reverse : _dijkstra-path -> _void)
(deftcod dijkstra-path-walk : _dijkstra-path (x : (_ptr o _int)) (y : (_ptr o _int)) ->
(r : _bool) -> (values r (cons x y)))
(deftcod dijkstra-delete : _dijkstra-path -> _void)