diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 27485d5..eaff5b6 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -6,7 +6,7 @@ jobs: build: runs-on: ubuntu-latest container: - image: pena/gitea-ocaml-ci:latest + image: zapashcanon/gitea-ocaml-ci:latest steps: - name: checkout uses: actions/checkout@v4 diff --git a/.ocamlformat b/.ocamlformat index 6f010c4..eb9f4e0 100644 --- a/.ocamlformat +++ b/.ocamlformat @@ -1,4 +1,4 @@ -version=0.28.1 +version=0.27.0 assignment-operator=end-line break-cases=fit break-fun-decl=wrap diff --git a/dune-project b/dune-project index fecf61a..1c009d1 100644 --- a/dune-project +++ b/dune-project @@ -1,15 +1,23 @@ (lang dune 2.9) -(name pellest) -(implicit_transitive_deps false) -(generate_opam_files true) -(authors "swrup@protonmail.com" "pena ") -(maintainers "swrup@protonmail.com" "pena ") +(implicit_transitive_deps false) + +(name pellest) + +(authors "swrup") + +(maintainers "swrup@protonmail.com") (source - (uri git+https://forge.kumikode.org/swrup/pellest.git)) -(homepage https://forge.kumikode.org/swrup/pellest) -(bug_reports https://forge.kumikode.org/swrup/pellest/issues) + (uri TODO/pellest)) + +(homepage TODO/pellest) + +(bug_reports TODO/pellest) + +(documentation TODO/pellest) + +(generate_opam_files true) (package (name pellest) @@ -20,20 +28,4 @@ (pellest TODO TODO TODO TODO)) (depends (ocaml - (>= 4.08)) - bos - brr - caqti - caqti-driver-sqlite3 - directories - dream - emile - fpath - lambdasoup - lwt - lwt_ppx - safepass - scfg - tyxml - uri - uuidm)) + (>= 4.08)))) diff --git a/pellest.opam b/pellest.opam index 140446e..72709f3 100644 --- a/pellest.opam +++ b/pellest.opam @@ -2,30 +2,15 @@ opam-version: "2.0" synopsis: "OCaml library/executable to TODO" description: "pellest is an OCaml library/executable to TODO." -maintainer: ["swrup@protonmail.com" "pena "] -authors: ["swrup@protonmail.com" "pena "] +maintainer: ["swrup@protonmail.com"] +authors: ["swrup"] tags: ["pellest" "TODO" "TODO" "TODO" "TODO"] -homepage: "https://forge.kumikode.org/swrup/pellest" -bug-reports: "https://forge.kumikode.org/swrup/pellest/issues" +homepage: "TODO/pellest" +doc: "TODO/pellest" +bug-reports: "TODO/pellest" depends: [ "dune" {>= "2.9"} "ocaml" {>= "4.08"} - "bos" - "brr" - "caqti" - "caqti-driver-sqlite3" - "directories" - "dream" - "emile" - "fpath" - "lambdasoup" - "lwt" - "lwt_ppx" - "safepass" - "scfg" - "tyxml" - "uri" - "uuidm" "odoc" {with-doc} ] build: [ @@ -44,4 +29,4 @@ build: [ ] ["dune" "install" "-p" name "--create-install-files" name] ] -dev-repo: "git+https://forge.kumikode.org/swrup/pellest.git" +dev-repo: "TODO/pellest" diff --git a/src/dune b/src/dune index c94d765..b35e495 100644 --- a/src/dune +++ b/src/dune @@ -17,8 +17,6 @@ user ws) (libraries - shared - ; bos caqti caqti.blocking @@ -26,6 +24,7 @@ directories dream emile + shared fpath lambdasoup lwt diff --git a/src/island_client.ml b/src/island_client.ml index cb9345d..1f25a64 100644 --- a/src/island_client.ml +++ b/src/island_client.ml @@ -191,22 +191,22 @@ let apply_last_key () = let open State in Kb.get_last () |> Option.iter (fun code_or_key -> - let act = - (* when you add something here, don't forget to add the corresponding case in `keypress_handler` *) - match code_or_key with - | "KeyW" | "ArrowUp" -> Move_offset Up - | "KeyA" | "ArrowLeft" -> Move_offset Left - | "KeyS" | "ArrowDown" -> Move_offset Down - | "KeyD" | "ArrowRight" -> Move_offset Right - | "m" -> Meditate - | "p" -> Plant_wheat - | _ -> - (* if this happen, it means we're adding + let act = + (* when you add something here, don't forget to add the corresponding case in `keypress_handler` *) + match code_or_key with + | "KeyW" | "ArrowUp" -> Move_offset Up + | "KeyA" | "ArrowLeft" -> Move_offset Left + | "KeyS" | "ArrowDown" -> Move_offset Down + | "KeyD" | "ArrowRight" -> Move_offset Right + | "m" -> Meditate + | "p" -> Plant_wheat + | _ -> + (* if this happen, it means we're adding bad values in `keypress_handler` and that should be fixed *) - assert false - in - Queue.add act input_queue ) + assert false + in + Queue.add act input_queue ) let render state = draw_canvas state; diff --git a/src/state.ml b/src/state.ml index bb1cd38..cc8af84 100644 --- a/src/state.ml +++ b/src/state.ml @@ -104,13 +104,14 @@ let rec check_action state = function ; Set_offset (offset_x, offset_y) ] in - begin match dir' with - | None -> Ok offset_action - | Some dir' -> begin - match check_action state (Move dir') with - | Error _e as e -> e - | Ok actions -> Ok (offset_action @ actions) - end + begin + match dir' with + | None -> Ok offset_action + | Some dir' -> begin + match check_action state (Move dir') with + | Error _e as e -> e + | Ok actions -> Ok (offset_action @ actions) + end end | Plant_wheat -> ( let { Map.x; y; dir } = state.player_pos in