Commit graph

18 commits

Author SHA1 Message Date
ebf0cb5bb8 Impl async delay on AI choice
This commit is also a stepping-stone towards handling http requests
which will require deferred callbacks on Yew Components. By figuring
out how to delay callbacks in this commit, it should be easier to
figure out how to handle http requests that may require a deferred
callback.
2022-03-15 13:16:09 +09:00
d8377d280a Tweaks to AI for correctness 2022-03-10 16:39:26 +09:00
89a12623b4 Incorporate game AI into game
Can select from three difficulties, and the AI makes their move when it
is their turn. AI probably still needs some tweaking..
2022-03-10 16:17:16 +09:00
e35870b240 Impl placed token indicator, fixes/refactorings 2022-03-10 15:43:03 +09:00
0d3d6b2a8d Fix typo 2022-03-09 19:29:00 +09:00
7e9718a743 Refactorings and linter fixes 2022-03-09 18:14:01 +09:00
76e6d3be52 Impl buttons indicator that won the game 2022-03-09 18:10:13 +09:00
b902b1c7b4 Impl use of win/draw check, fixes
Also added unit tests for win/draw checks.
2022-03-09 17:29:53 +09:00
5e2c5b6d41 Minor refactoring
Use "From<>" instead of "Into<>" for MainMenuMessage to GameState.
2022-03-07 13:14:57 +09:00
2e58bc1288 Set up API for AI choice of slot on board 2022-03-07 13:12:05 +09:00
130cc42d86 Impl main menu
Only "LocalMultiplayer" can be chosen for the game-mode since neither
AI nor Networked-Multiplayer has been implemented yet.
2022-03-04 16:22:30 +09:00
079bf6229f Impl convenience functions, refactoring 2022-03-03 18:01:46 +09:00
462dec9ea1 Remove NodeRef for getter, improve turn indicator
All NodeRefs have been removed in favor of "getElementById".

Turn indicator is now much more obvious to see.
2022-03-03 17:36:51 +09:00
52b841d98a Replace slot "ref" with "id" 2022-03-03 14:08:35 +09:00
3b4d8b3483 Impl additional info text box, drop logic
Can place tokens, and not place tokens where there already is a token.

Additional info text box added to the side of the board.

More information to the UI regarding placed tokens.
2022-03-02 17:51:14 +09:00
8838dbae69 Cleanup and fixes
Remove state::MessageBus in favor of String messages sent to Wrapper
from Slot.

Update Slot state from inside Wrapper::update such that changes should
be immediately visible per Slot (moved code from Wrapper::rendered,
fixing updates not being immediately visble).
2022-03-02 16:25:01 +09:00
45e2c88745 Reverse info_text vertically
info_text's latest messages now appear at the top instead of at the
bottom.
2022-03-02 15:38:24 +09:00
15c7dc7654 Reorganize front-end source into modules 2022-03-02 15:18:21 +09:00