Class: Rubygoal::CoachHome

Inherits:
Coach
  • Object
show all
Defined in:
lib/rubygoal/coaches/coach_home.rb

Instance Method Summary collapse

Instance Method Details

#formation(match) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/rubygoal/coaches/coach_home.rb', line 10

def formation(match)
  formation = Formation.new

  if match.me.winning?
    formation.defenders = [:average, :average, :average, :captain, :average]
    formation.midfielders = [:average, :none, :fast, :none, :average]
    formation.attackers = [:none, :fast, :none, :fast, :none]
  elsif match.time < 20
    formation.defenders = [:none, :fast, :average, :average, :none]
    formation.midfielders = [:average, :average, :captain, :none, :average]
    formation.attackers = [:fast, :none, :none, :fast, :average]
  else
    formation.lineup = match.other.formation.lineup
  end

  formation
end

#nameObject



6
7
8
# File 'lib/rubygoal/coaches/coach_home.rb', line 6

def name
  "Wanderers"
end