add point

This commit is contained in:
Swrup 2022-04-12 15:26:49 +02:00
parent e7e40c3ce9
commit 47c442f84b
5 changed files with 27 additions and 7 deletions

11
src/point.ml Normal file
View file

@ -0,0 +1,11 @@
(* BSD-2-Clause License *)
type t =
{ x : int
; y : int
}
let of_jv point =
let x = Jv.get point "x" |> Jv.to_int in
let y = Jv.get point "y" |> Jv.to_int in
{ x; y }