Class: BCDice::GameSystem::OneWayHeroics::BranchByDayParity

Inherits:
BranchByDay
  • Object
show all
Defined in:
lib/bcdice/game_system/one_way_heroics/random_event_table.rb

Instance Method Summary collapse

Methods inherited from BranchByDay

#initialize, #roll_with_day

Constructor Details

This class inherits a constructor from BCDice::GameSystem::OneWayHeroics::BranchByDay

Instance Method Details

#branch_result(value, _) ⇒ Object



94
95
96
97
98
99
100
# File 'lib/bcdice/game_system/one_way_heroics/random_event_table.rb', line 94

def branch_result(value, _)
  if value.odd?
    "奇数"
  else
    "偶数"
  end
end

#choice(value, _) ⇒ Object



90
91
92
# File 'lib/bcdice/game_system/one_way_heroics/random_event_table.rb', line 90

def choice(value, _)
  value.odd? ? @greater : @less_than_equal
end