addGame
This commit is contained in:
@@ -68,4 +68,11 @@ public class HockeyPlayer {
|
||||
HockeyPlayer p = (HockeyPlayer) o;
|
||||
return this.name.compareTo(p.name);
|
||||
}
|
||||
|
||||
public void addGame(int goals, int assists, boolean gameWon){
|
||||
this.goals += goals;
|
||||
this.assists += assists;
|
||||
if (gameWon) gamesWon++;
|
||||
else gamesLost++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user