Class: Tundengine::Player::InMatch

Inherits:
Object
  • Object
show all
Includes:
AlgebraicDataType
Defined in:
lib/tundengine/player/in_match.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AlgebraicDataType

#==, #hash

Constructor Details

#initialize(name, strategy) ⇒ InMatch

Returns a new instance of InMatch.



9
10
11
12
13
# File 'lib/tundengine/player/in_match.rb', line 9

def initialize(name, strategy)
  @name         = name
  @strategy     = strategy
  @match_points = 0
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/tundengine/player/in_match.rb', line 7

def name
  @name
end

#strategyObject (readonly)

Returns the value of attribute strategy.



7
8
9
# File 'lib/tundengine/player/in_match.rb', line 7

def strategy
  @strategy
end

Instance Method Details

#identifierObject



19
20
21
# File 'lib/tundengine/player/in_match.rb', line 19

def identifier
  [@name]
end

#in_new_roundObject



23
24
25
# File 'lib/tundengine/player/in_match.rb', line 23

def in_new_round
  InRound.new(self)
end

#to_sObject



15
16
17
# File 'lib/tundengine/player/in_match.rb', line 15

def to_s
  @name
end