diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2017-12-16 20:37:10 +0000 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2017-12-16 20:37:10 +0000 |
commit | 1b1704512b4c83dfa7e17c30f0facc5a7645181a (patch) | |
tree | f843823210be5dda636d2ba3f5149ba9f54cd876 /src/game/game.cpp | |
parent | 273c601a94464bef2161b9c3a29ea3cf901340e9 (diff) |
Clean up unit parameters a bit.
Diffstat (limited to 'src/game/game.cpp')
-rw-r--r-- | src/game/game.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/game/game.cpp b/src/game/game.cpp index 51dca09..9584817 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -178,32 +178,32 @@ void state_t::wake_everything(v2f_t x, float range) } } -roll_params_t::roll_params_t(size_t sides_) +die_t::die_t(size_t sides_) { sides = sides_; } -roll_params_t::roll_params_t(size_t count_, size_t sides_) +die_t::die_t(size_t count_, size_t sides_) { count = count_; sides = sides_; } -roll_params_t::roll_params_t(size_t count_, size_t sides_, size_t bonus_) +die_t::die_t(size_t count_, size_t sides_, size_t bonus_) { count = count_; sides = sides_; bonus = bonus_; } -size_t state_t::roll(roll_params_t *P) +size_t state_t::roll(die_t die) { size_t total = 0; - for (size_t i = 0; i < P->count; i++) - total += dice_prng.next() % P->sides + 1; + for (size_t i = 0; i < die.count; i++) + total += dice_prng.next() % die.sides + 1; - return total + P->bonus; + return total + die.bonus; } bool load_assets(void) |