Class: Rubygoal::AwayTeam

Inherits:
Team
  • Object
show all
Defined in:
lib/rubygoal/teams/away.rb

Constant Summary

Constants inherited from Team

Team::INFINITE

Instance Attribute Summary

Attributes inherited from Team

#coach, #formation, #opponent_side, #players, #side

Instance Method Summary collapse

Methods inherited from Team

#players_list, #players_position, #players_to_initial_position, #update

Constructor Details

#initialize(*args) ⇒ AwayTeam

Returns a new instance of AwayTeam.



5
6
7
8
9
# File 'lib/rubygoal/teams/away.rb', line 5

def initialize(*args)
  @side = :away
  @opponent_side = :home
  super
end

Instance Method Details

#teammate_is_on_front?(player, teammate) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/rubygoal/teams/away.rb', line 11

def teammate_is_on_front?(player, teammate)
  teammate.position.x < player.position.x - 40
end