From 718bf61d0c2b4400c9b8338fa67137f4e0ba225d Mon Sep 17 00:00:00 2001 From: Sara Date: Wed, 17 Sep 2025 22:00:07 +0200 Subject: [PATCH] feat: added die_to_str --- src/dice.c | 12 ++++++++++++ src/dice.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/src/dice.c b/src/dice.c index 50acdf4..9da3369 100644 --- a/src/dice.c +++ b/src/dice.c @@ -42,3 +42,15 @@ struct roll_result_type roll_active_dice_set(enum die_type die) { return results; } +Clay_String die_to_str(enum die_type die) { + switch (die) { + case COIN: return CLAY_STRING("C"); + case D4: return CLAY_STRING("4"); + case D6: return CLAY_STRING("6"); + case D8: return CLAY_STRING("8"); + case D10: return CLAY_STRING("10"); + case D12: return CLAY_STRING("12"); + case D20: return CLAY_STRING("20"); + case D100: return CLAY_STRING("100"); + } +} diff --git a/src/dice.h b/src/dice.h index fe0bc23..27d19bf 100644 --- a/src/dice.h +++ b/src/dice.h @@ -1,6 +1,7 @@ #ifndef DICE_H #define DICE_H +#include "renderer/clay_renderer_SDL3.h" #include #ifndef MAX_ACTIVE_DICE @@ -31,4 +32,6 @@ extern size_t add_die_to_active(enum die_type die); extern void remove_die_from_active(size_t index); extern struct roll_result_type roll_active_dice_set(enum die_type die); +extern Clay_String die_to_str(enum die_type die); + #endif // !DICE_H