// Copyright 2025 Bill Rossi // // This file is part of Hanafuda Hachi-Hachi. // // Hanafuda Hachi-Hachi is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. // // Hanafuda Hachi-Hachi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along with Hanafuda Hachi-Hachi. If not, see . #ifndef _HF_GAME_ #define _HF_GAME_ #include typedef struct Game Game; #include "card.h" #include "field_multiplier.h" #include "teyaku.h" #include "dekiyaku.h" #include "points.h" #include "player.h" #include "dialog.h" #include "options.h" #include "title.h" typedef enum GameState { GAME_STATE_INITIALIZING, GAME_STATE_DEALING, GAME_STATE_CALCULATING_FIELD_MULTIPLIER, GAME_STATE_CALCULATING_TEYAKU, GAME_STATE_START_OF_TURN, GAME_STATE_CHECKING_FOR_CANCEL, GAME_STATE_CHOOSING_FROM_HAND, GAME_STATE_CHOOSING_TARGET, GAME_STATE_SHOWING_CARD_FROM_DECK, GAME_STATE_PLAYING_FROM_DECK, GAME_STATE_CHOOSING_TARGET_FROM_DECK, GAME_STATE_CHECKING_FOR_NEW_DEKIYAKU, GAME_STATE_SELECTING_DEKIYAKU_ACTION, GAME_STATE_CALCULATING_SCORES, GAME_STATE_CALCULATING_DEKIYAKU_SCORE, GAME_STATE_END_OF_ROUND, GAME_STATE_END_OF_GAME, GAME_STATE_NEW_GAME, GAME_STATE_TITLE_SCREEN, GAME_STATE_OPTIONS, } GameState; struct Game { GameState state; bool should_close; Card cards[48]; Texture2D cards_texture_red, cards_texture_black; Hand deck, field; FieldMultiplier *field_multiplier; Card *current_play_from_hand, *current_play_target; Player player, right, left; Player *first_sage; int temp_points; int turn_number; Dialog *dialog; Player *dealer; int current_round; int kan_value; int number_of_rounds; bool black_card_backs; float deal_speed; Options *options; Title *title; }; void initialize_game(Game *g); void run_until_closing(Game *g); void transfer_points(Game *g, int *to, int *from, int amount); void transfer_kan(Game *g, int *to, int *from, int amount); #endif