From 93ae544684b29db30c6c65a5ba5e7cb51972123c Mon Sep 17 00:00:00 2001 From: Simponic Date: Wed, 4 Jan 2023 00:03:38 -0700 Subject: Create a Screen module behaviour, some ascii character arts, handle_input does stuff now --- lib/chessh/ssh/screens/board.ex | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/chessh/ssh/screens/board.ex (limited to 'lib/chessh/ssh/screens/board.ex') diff --git a/lib/chessh/ssh/screens/board.ex b/lib/chessh/ssh/screens/board.ex new file mode 100644 index 0000000..7b22052 --- /dev/null +++ b/lib/chessh/ssh/screens/board.ex @@ -0,0 +1,15 @@ +defmodule Chessh.SSH.Client.Board do + use Chessh.SSH.Client.Screen + alias Chessh.SSH.Client.State + + def render(%State{} = _state) do + @ascii_chars["pieces"]["white"]["knight"] + end + + def handle_input(action, state) do + case action do + "q" -> state + _ -> state + end + end +end -- cgit v1.3