public void ScoreGoalsVisitingTeam(int goal) { VisitingTeamGoals = goal; for (int i = 0; i < goal; i++) { VisitingTeam.ScoreAGoal(); HomeTeam.Table.ScoreConcededGoals(); } }
public void AdicionarGol(Player player, bool against) { if (player.Team.Id == HomeTeam.Id) { if (!against) { this.GoalsHomeTeam++; VisitingTeam.TakeGoal(); player.Team.AddGoal(); player.AddGoal(); } else { this.GoalsVisitingTeam++; VisitingTeam.AddGoal(); HomeTeam.TakeGoal(); player.AddGoalAgainst(); } } else { if (!against) { this.GoalsVisitingTeam++; HomeTeam.TakeGoal(); player.Team.AddGoal(); player.AddGoal(); } else { this.GoalsHomeTeam++; HomeTeam.AddGoal(); VisitingTeam.TakeGoal(); player.AddGoalAgainst(); } } }
public void PlayMatch(List <string> HplayerNames, List <string> VplayerNames) { HomeTeamGoals = 0; VisitingTeamGoals = 0; foreach (var name in HplayerNames) { var HomePlayer = HomeTeam.GetPlayerById(HomeTeam.GetPlayerIdByName(name)); HomePlayer.GiveGoal(); ScoreGoalHomeTeam(); } foreach (var name in VplayerNames) { var VisitingPlayer = VisitingTeam.GetPlayerById(VisitingTeam.GetPlayerIdByName(name)); VisitingPlayer.GiveGoal(); ScoreGoalVisitingTeam(); } if (HomeTeamGoals > VisitingTeamGoals) { HomeTeam.ScoreWin(); VisitingTeam.ScoreDefeat(); } else if (HomeTeamGoals < VisitingTeamGoals) { VisitingTeam.ScoreWin(); HomeTeam.ScoreDefeat(); } else { VisitingTeam.ScoreDraw(); HomeTeam.ScoreDraw(); } }
public void ScoreGoalVisitingTeam() { VisitingTeamGoals++; VisitingTeam.ScoreMakedGoals(); HomeTeam.ScoreConcededGoals(); }
public void PlayMatch() { HomeTeamGoals = 0; VisitingTeamGoals = 0; VisitingTeam.ScoreDraw(); HomeTeam.ScoreDraw(); }