summaryrefslogtreecommitdiff
path: root/lib/chessh/ssh/client/menus/create_game.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chessh/ssh/client/menus/create_game.ex')
-rw-r--r--lib/chessh/ssh/client/menus/create_game.ex42
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/chessh/ssh/client/menus/create_game.ex b/lib/chessh/ssh/client/menus/create_game.ex
new file mode 100644
index 0000000..99d2c0e
--- /dev/null
+++ b/lib/chessh/ssh/client/menus/create_game.ex
@@ -0,0 +1,42 @@
+defmodule Chessh.SSH.Client.CreateGameMenu do
+ alias IO.ANSI
+
+ alias Chessh.PlayerSession
+ alias Chessh.SSH.Client.Game
+
+ require Logger
+
+ use Chessh.SSH.Client.SelectPaginatePoller
+
+ def dynamic_options(), do: false
+ def tick_delay_ms(), do: 1000
+ def max_displayed_options(), do: 4
+ def title(), do: ["-- Create A New Game --"]
+
+ def initial_options(%State{player_session: %PlayerSession{} = player_session}) do
+ [
+ {"😀 vs 😀 | ⬜ White", {Game, %Game.State{player_session: player_session, color: :light}}},
+ {"😀 vs 😀 | ⬛ Black", {Game, %Game.State{player_session: player_session, color: :dark}}},
+ {"😀 vs 🤖 | ⬜ White",
+ {Chessh.SSH.Client.SelectBot,
+ %Chessh.SSH.Client.SelectPaginatePoller.State{
+ player_session: player_session,
+ extra_info: %{
+ color: :light
+ }
+ }}},
+ {"🤖 vs 😀 | ⬛ Black",
+ {Chessh.SSH.Client.SelectBot,
+ %Chessh.SSH.Client.SelectPaginatePoller.State{
+ player_session: player_session,
+ extra_info: %{
+ color: :dark
+ }
+ }}}
+ ]
+ end
+
+ def make_process_tuple(selected, _state) do
+ selected
+ end
+end