Class: Linotype::Player
- Inherits:
-
Object
- Object
- Linotype::Player
- Defined in:
- lib/linotype/player.rb
Constant Summary collapse
- DEFAULT_STRATEGY =
->(move) { (move.score[:defended] * 2) + move.score[:covered] }
Instance Attribute Summary collapse
-
#strategy ⇒ Object
Returns the value of attribute strategy.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Player
constructor
A new instance of Player.
Constructor Details
#initialize(args = {}) ⇒ Player
Returns a new instance of Player.
8 9 10 11 |
# File 'lib/linotype/player.rb', line 8 def initialize(args={}) args = { strategy: DEFAULT_STRATEGY }.merge(args) self.strategy = args[:strategy] end |
Instance Attribute Details
#strategy ⇒ Object
Returns the value of attribute strategy.
6 7 8 |
# File 'lib/linotype/player.rb', line 6 def strategy @strategy end |