Class: Mjai::Context
- Inherits:
-
Object
- Object
- Mjai::Context
- Extended by:
- WithFields
- Defined in:
- lib/mjai/context.rb
Overview
Context of the game which affects hora yaku and points.
Instance Attribute Summary
Attributes included from WithFields
Instance Method Summary collapse
- #fanpai_fan(pai) ⇒ Object
-
#initialize(fields) ⇒ Context
constructor
A new instance of Context.
Methods included from WithFields
Constructor Details
#initialize(fields) ⇒ Context
Returns a new instance of Context.
17 18 19 |
# File 'lib/mjai/context.rb', line 17 def initialize(fields) @fields = fields end |
Instance Method Details
#fanpai_fan(pai) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/mjai/context.rb', line 21 def fanpai_fan(pai) if pai.sangenpai? return 1 else fan = 0 fan += 1 if pai == self.bakaze fan += 1 if pai == self.jikaze return fan end end |