From eec32aa38a8762eccc8575a37a628bd5ae2cc1d0 Mon Sep 17 00:00:00 2001 From: "Elizabeth (Lizzy) Hunt" Date: Mon, 29 May 2023 16:28:27 -0700 Subject: Bots (#23) * squash all the things for bots * fix warnings * change colors a bit and README updates * fix frontend warnings --- lib/chessh/ssh/client/menus/create_game.ex | 42 ++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 lib/chessh/ssh/client/menus/create_game.ex (limited to 'lib/chessh/ssh/client/menus/create_game.ex') 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 -- cgit v1.3