Class: Rubygoal::HomeTeam

Inherits:
Team
  • Object
show all
Defined in:
lib/rubygoal/teams/home.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) ⇒ HomeTeam

Returns a new instance of HomeTeam.



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

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

Instance Method Details

#teammate_is_on_front?(player, teammate) ⇒ Boolean

Returns:

  • (Boolean)


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

def teammate_is_on_front?(player, teammate)
  teammate.position.x > player.position.x + 40
end