Class: Tablescript::RollAndIgnoreStrategy

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

Overview

RollAndIgnoreStrategy

Instance Method Summary collapse

Constructor Details

#initialize(table, rollset, roller = nil) ⇒ RollAndIgnoreStrategy

Returns a new instance of RollAndIgnoreStrategy.



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

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

Instance Method Details

#rollObject



31
32
33
34
# File 'lib/tablescript/roll_and_ignore_strategy.rb', line 31

def roll
  evaluate
  @roll
end

#valueObject



36
37
38
39
# File 'lib/tablescript/roll_and_ignore_strategy.rb', line 36

def value
  evaluate
  @value
end