chore: moved Dice_Roll to location that matches with the header
This commit is contained in:
parent
a379de4374
commit
f379ed1b86
18
src/dice.c
18
src/dice.c
|
|
@ -1,15 +1,6 @@
|
||||||
#include "dice.h"
|
#include "dice.h"
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
|
|
||||||
int Dice_Roll(enum Dice_Die die) {
|
|
||||||
if (die == COIN) {
|
|
||||||
return (rand() % 2);
|
|
||||||
} else {
|
|
||||||
int const max = die;
|
|
||||||
return (rand() % max) + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int activeDiceCount = 0;
|
static int activeDiceCount = 0;
|
||||||
static enum Dice_Die activeDice[MAX_ACTIVE_DICE];
|
static enum Dice_Die activeDice[MAX_ACTIVE_DICE];
|
||||||
|
|
||||||
|
|
@ -19,6 +10,15 @@ static struct Dice_ResultType rollTotal = {
|
||||||
.roll = 0, .string_len = 1,
|
.roll = 0, .string_len = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int Dice_Roll(enum Dice_Die die) {
|
||||||
|
if (die == COIN) {
|
||||||
|
return (rand() % 2);
|
||||||
|
} else {
|
||||||
|
int const max = die;
|
||||||
|
return (rand() % max) + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
struct Dice_ResultType Dice_RollToResultType(int roll, enum Dice_Die die) {
|
struct Dice_ResultType Dice_RollToResultType(int roll, enum Dice_Die die) {
|
||||||
struct Dice_ResultType result = { };
|
struct Dice_ResultType result = { };
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue