#include "card.h" static Vector2 card_size = (Vector2) { CARD_WIDTH, CARD_HEIGHT }; static char *month_english_abbr[12] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; void draw_card(Card *c) { DrawRectangleV(c->position, card_size, c->selected ? RED : BLACK); DrawRectangle(c->position.x + CARD_BORDER, c->position.y + CARD_BORDER, card_size.x - (CARD_BORDER * 2), card_size.y - (CARD_BORDER * 2) , WHITE); DrawText(month_english_abbr[c->month], c->position.x + CARD_BORDER + 2, c->position.y + CARD_BORDER + 2, 14, BLACK); switch (c->type) { case CHAFF: break; case RIBBON: Color ribbon_color = RED; if (c->ribbon_type == RIBBON_BLUE) ribbon_color = BLUE; DrawRectangle(c->position.x + 26, c->position.y + 35, 10, 45 , ribbon_color); if (c->ribbon_type == RIBBON_POETRY) { DrawRectangle(c->position.x + 29, c->position.y + 38, 4, 39 , BLACK); } break; case ANIMAL: DrawRectangle(c->position.x + 10, c->position.y + 45, 40, 25 , BLACK); break; case BRIGHT: DrawCircle(c->position.x + 31, c->position.y + 65, 25 , YELLOW); break; } } bool point_within_card(Card *c, Vector2 point) { return point.x > c->position.x && point.x < c->position.x + card_size.x && point.y > c->position.y && point.y < c->position.y + card_size.y; }