← Back to index
class HockeyGame

Represent a the scoring of a hockey game. The two teams playing are "home" and "away".

Constructors
🔗
HockeyGame ()
Properties
🔗
away : number

Score of the "away" team

🔗
home : number

Score of the "home" team

Methods
🔗
awayTeamScores (): void

Call this method when away team scores. It will increase home team score by 1 point.

🔗
homeTeamScores (): void

Call this method when home team scores. It will increase home team score by 1 point.

🔗
winner ()

Returns winner of the game.