rubygoal icon indicating copy to clipboard operation
rubygoal copied to clipboard

Formation line block does not work after defining the players' line

Open jmbejar opened this issue 9 years ago • 0 comments

Using the option to redefine the players line positions, in the Formation class, is not always working.

If you define the lines positions before defining the players that are in the line, it works:

formation = Formation.new
formation.lineup do
  lines do
    defenders 15
  end

  defenders :none, :average2, :fast1, :average5, :none
  midfielders :average1,  :average4, :fast2, :captain, :average6
  attackers :none, :average3, :none, :fast3, :none
end

However, it doesn't work in the line block appears after the definition:

formation = Formation.new
formation.lineup do
  defenders :none, :average2, :fast1, :average5, :none
  midfielders :average1,  :average4, :fast2, :captain, :average6
  attackers :none, :average3, :none, :fast3, :none

  lines do
    defenders 15
  end
end

jmbejar avatar Apr 07 '16 18:04 jmbejar