public class Fixture
{
   public Fixture(Team theHomeTeam, Team theAwayTeam)
   {  homeTeam = theHomeTeam;
      awayTeam = theAwayTeam;
      hasBeenPlayed = false; // unnec
   }

   public void setScore(int theHomeGoals, int theAwayGoals)
   {  hasBeenPlayed = true;
      homeGoals = theHomeGoals;
      awayGoals = theAwayGoals;
      if (homeGoals == awayGoals)
      {  homeTeam.addToPoints(DRAW_POINTS);
         awayTeam.addToPoints(DRAW_POINTS);
      }
      else if (homeGoals > awayGoals)
      {  homeTeam.addToPoints(WIN_POINTS);
      }
      else // away win
      {  awayTeam.addToPoints(WIN_POINTS);
      }
   }

   public String toString()
   {  if (hasBeenPlayed)
      {   return homeTeam.getName() + " " + homeGoals + " " + 
             awayTeam.getName() + " " + awayGoals;
      }
      else // not played yet
      {  return homeTeam.getName() + " - " +
            awayTeam.getName() + " - ";
      }
   }

   private boolean hasBeenPlayed;
   private Team homeTeam;
   private Team awayTeam;
   private int homeGoals;
   private int awayGoals;
   private static final int DRAW_POINTS = 1;
   private static final int WIN_POINTS = 3;
}
