Class: Stattr::Game
- Inherits:
-
Object
- Object
- Stattr::Game
- Defined in:
- lib/stattr.rb
Overview
The Class that defines, in other applications, the “rules” of that game - the stats, the sides of a given die, and so on.
Class Method Summary collapse
-
.dice_num ⇒ Integer
The number of dice required to create a stat in this game.
-
.dice_sides ⇒ Integer
How many sides the generating dice have in this game.
-
.make_stat(val = 1) ⇒ Object
The math for generating a stat.
-
.stats ⇒ Array
The list of stats for this game.
Class Method Details
.dice_num ⇒ Integer
The number of dice required to create a stat in this game
23 24 25 |
# File 'lib/stattr.rb', line 23 def self.dice_num 3 end |
.dice_sides ⇒ Integer
How many sides the generating dice have in this game.
15 16 17 |
# File 'lib/stattr.rb', line 15 def self.dice_sides 6 end |
.make_stat(val = 1) ⇒ Object
The math for generating a stat.
31 32 33 |
# File 'lib/stattr.rb', line 31 def self.make_stat(val=1) Stat.new(DiceRoll.new_roll(Game.dice_sides, Game.dice_num)) end |
.stats ⇒ Array
The list of stats for this game.
39 40 41 |
# File 'lib/stattr.rb', line 39 def self.stats ["str", "con", "wis", "int", "cha", "dex"] end |