#ifndef SERVER_GAME_PROCESS_H_SENTRY #define SERVER_GAME_PROCESS_H_SENTRY #include "card_stack.h" #include "server.h" #include "card_queue.h" enum { start_deck_size = 6 }; struct game_info { int players_number; int *card_quantity_arr; int shuffled_cards_left; const char* trump_suit; int position_whose_turn; struct cards_on_table *cot; struct card_queue *cq; }; const char** get_shuffled_deck(); void deal_first_cards(const char **shuffled_deck, int *cards_left, player_cards *deck); void deal_cards(const char **shuffled_deck, int *shuffled_cards_left, struct session **turn_queue, int players_number, int *card_quantity_arr); const char* find_trump_suit(const char **shuffled_deck, int *cards_left); int find_lowest_trump(player_cards deck, const char *trump); void shift_turn_queue_by_one(struct session **turn_queue, int size); void move_turn_queue_two_players_ahead(struct session **turn_queue, int size); void update_card_quantity_arr(struct server *serv); struct game_info* get_new_game_info(int players_number, int *card_quantity_arr, int shuffled_cards_left, const char *trump_suit, int position_whose_turn, struct card_queue *cq, struct cards_on_table *cot); int is_card_bit(const char *attack_card, const char *defend_card, const char *trump_suit); int check_defender_can_defend(struct card_queue *cq, player_cards deck, const char *trump_suit); void update_game_info(struct game_info *gi, int players_number, int shuffled_cards_left, int position_whose_turn); int check_someone_can_toss_card(struct session **turn_queue, int players_quantity, struct card_queue *cq, struct cards_on_table *cot); int check_player_can_toss_card(player_cards deck, struct cards_on_table *cot); int is_correct_tossing_card(const char *card, struct cards_on_table *cot); void put_all_cards_from_queue_to_table(struct cards_on_table *cot, struct card_queue *cq); void put_one_card_from_queue_to_table(struct cards_on_table *cot, struct card_queue *cq); void put_defender_card_on_table(struct cards_on_table *cot, const char *card); void move_all_cards_to_defender(struct cards_on_table *cot, player_cards *deck); void remove_cards_from_table(struct cards_on_table *cot); int calculate_defense_card_quantity_on_table(const struct cards_on_table *cot); int calculate_attack_card_quantity_on_table(const struct cards_on_table *cot); int check_all_answers_were_received(const struct session **turn_queue, int size); #endif