Class: Tablescript::RollStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/tablescript/roll_strategy.rb

Overview

RollStrategy

Instance Method Summary collapse

Constructor Details

#initialize(table, roller = nil) ⇒ RollStrategy

Returns a new instance of RollStrategy.



23
24
25
26
27
28
# File 'lib/tablescript/roll_strategy.rb', line 23

def initialize(table, roller = nil)
  @table = table
  @roller = roller || RpgLib::DiceRoller.instance
  @roll = nil
  @value = nil
end

Instance Method Details

#rollObject



30
31
32
33
# File 'lib/tablescript/roll_strategy.rb', line 30

def roll
  evaluate
  @roll
end

#valueObject



35
36
37
38
# File 'lib/tablescript/roll_strategy.rb', line 35

def value
  evaluate
  @value
end