module World:sig..end
type ('a, 'b) t =
| |
World of |
(* | 'a is the type of world states世界の型が 'a | *) |
| |
Package of |
(* | 'a is the type of world states,
'b is the type of messages世界の型が 'a、メッセージの型が 'b | *) |
val big_bang : ?name:string ->
?width:int ->
?height:int ->
?to_draw:('a -> Image.t) ->
?on_tick:('a -> ('a, 'b) t) ->
?on_mouse:('a -> float -> float -> string -> ('a, 'c) t) ->
?on_key_press:('a -> string -> ('a, 'd) t) ->
?on_key_release:('a -> string -> ('a, 'e) t) ->
?rate:float ->
?stop_when:('a -> bool) ->
?to_draw_last:('a -> Image.t) ->
?register:string * string ->
?on_receive:('a -> 'f -> ('a, 'g) t) -> 'a -> unitname : ゲームのウィンドウの名前width height : ウィンドウの横幅、縦幅to_draw : 世界を受け取ったら画像を返す関数on_tick : 世界を受け取ったら 1 tick 後の世界を返す関数on_mouse : 世界とマウス座標とマウスイベント名を受け取ったら、
新しい世界を返す関数on_key_press : 世界と押されたキー名を受け取ったら、
新しい世界を返す関数on_key_release : 世界と離されたキー名を受け取ったら、
新しい世界を返す関数rate : 1 tick の間隔(秒)stop_when : 世界を受け取り、ゲーム終了ならtrueを返す関数to_draw_last : 世界を受け取り、
ゲーム終了の際に描かれる画面を返す関数register : サーバのIPアドレスとポート番号on_receive : 世界と新しいメッセージを受け取ったら
新しい世界を返す関数'a : 世界、つまり world の初期値(必須)