#include "hand.h" #include #include #include "card.h" static int hand_comparator(const void *a, const void *b) { card c1 = *(card *)a; card c2 = *(card *)b; return c1 - c2; } void hand_sort(hand_t *h) { assert(h != NULL); qsort(h->cards, MAX_HAND_CARDS, sizeof(card), hand_comparator); } void hand_remove_card(hand_t *h, const uint8_t card_index) { assert(h != NULL); h->cards[card_index] = 0; }