Refactor/state machine (#470)

* initial additions

* Move current_blind to game vars

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* Compile but is broken

* temp fix for token location

* tmp

* Working, lets clean up

* remove todo

* Remove odd reroll blind variable

* fix skipping blind screen

* fix reroll

* remove magic for blind token locations

* clang format

* Cleanup button highlight in blind menu

* some cleanup

* Add layout file for global UI rects

* remove dead code

* Clang format

* clang format it up

* Move reset top left funct to gfx utils

* make note of soon-to-be removed vars

* Cleanup gamevars declaration

* Cleanup layout file

* Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Add include for stdbool.h in common_ui.h

* Cleanup rect declaration

* Start moving state machine stuff to new file

* quick tmp

* oops, add new files

* working call list

* fixed pointer stuff

* working as per norm

* working replacement

* move defines to static const

* fix compile issue

* Add some missing "void"s

* Working new substates

* add statemachine to blind select

* Fix game restart statemachine leak

* clang-format

* Clang format

* Rework shop exit logic

* Use new state machine in shop

* Remove substates entirely

* Remove debug stuff

* Clang format

* document state machine better

* update list tests

* clang-format

* Update for PR

* Claaaaang format

* another clang-format

* Remove extra state in round_end

* cleanup docs for removals in lists

* clang-format... again

* update doxygen format

* Clang format

* Update list docs

* Update lists tests

* Fix bad conflict resolution

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Rickey
2026-05-22 18:06:13 -07:00
committed by GitHub
co-authored by Copilot Autofix powered by AI
parent 2329c4c681
commit 92cb9f9883
11 changed files with 428 additions and 165 deletions
+25 -2
View File
@@ -1,3 +1,9 @@
/**
* @file list.c
*
* @brief List functions implementation.
*/
#include "list.h"
#include "pool.h"
@@ -29,9 +35,9 @@ static void s_list_remove_node(List* list, ListNode* node);
*/
static ListNode* s_list_itr_node_next(ListItr* itr);
List list_create(void)
List list_init(void)
{
List list = {.head = NULL, .tail = NULL, .len = 0};
List list = LIST_DEFAULT;
return list;
}
@@ -306,3 +312,20 @@ void list_itr_remove_current_node(ListItr* itr)
s_list_remove_node(itr->list, itr->current_node);
itr->current_node = tmp_prev;
}
bool list_remove_data(List* list, void* data)
{
ListItr itr = list_itr_create(list);
ListNode* ln;
while ((ln = s_list_itr_node_next(&itr)))
{
if (ln->data == data)
{
s_list_remove_node(list, ln);
return true;
}
}
return false;
}