Class: Tundengine::Declarations::LasVeinte

Inherits:
Base
  • Object
show all
Includes:
AlgebraicDataType
Defined in:
lib/tundengine/declarations/las_veinte.rb

Constant Summary collapse

ROUND_POINTS =
20

Instance Attribute Summary

Attributes inherited from Base

#round_points

Class Method Summary collapse

Instance Method Summary collapse

Methods included from AlgebraicDataType

#==, #hash, #to_s

Methods inherited from Base

#finishes_round?, #has_tute_effect?

Methods included from Move

#self_or_yield, #yield_self_or_lock!

Methods included from StringifiableByClass

#to_s

Constructor Details

#initialize(suit) ⇒ LasVeinte

Returns a new instance of LasVeinte.



14
15
16
17
# File 'lib/tundengine/declarations/las_veinte.rb', line 14

def initialize(suit)
  @suit = suit
  super()
end

Class Method Details

.en(suit) ⇒ Object



9
10
11
12
# File 'lib/tundengine/declarations/las_veinte.rb', line 9

def self.en(suit)
  s = suit.is_a?(Suits::Base) ? suit : suit.instance
  new(s)
end

Instance Method Details

#identifierObject



23
24
25
# File 'lib/tundengine/declarations/las_veinte.rb', line 23

def identifier
  [@suit]
end

#is_declarable?(hand, trump_suit) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/tundengine/declarations/las_veinte.rb', line 19

def is_declarable?(hand, trump_suit)
  @suit != trump_suit and hand.has_knight_and_king_of?(@suit)
end