feat: added die_to_str
This commit is contained in:
		
							parent
							
								
									1d0ce38e65
								
							
						
					
					
						commit
						718bf61d0c
					
				
							
								
								
									
										12
									
								
								src/dice.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								src/dice.c
									
									
									
									
									
								
							| 
						 | 
					@ -42,3 +42,15 @@ struct roll_result_type roll_active_dice_set(enum die_type die) {
 | 
				
			||||||
	return results;
 | 
						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");
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,7 @@
 | 
				
			||||||
#ifndef DICE_H
 | 
					#ifndef DICE_H
 | 
				
			||||||
#define DICE_H
 | 
					#define DICE_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "renderer/clay_renderer_SDL3.h"
 | 
				
			||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef MAX_ACTIVE_DICE
 | 
					#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 void remove_die_from_active(size_t index);
 | 
				
			||||||
extern struct roll_result_type roll_active_dice_set(enum die_type die);
 | 
					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
 | 
					#endif // !DICE_H
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue