how are points won calculated?

had a question... since a person's rank and number of points change during the course of a game, how many points are awarded at the end of a game? Is it based on how many points the defeated opponent had when they joined the game or how many points they player had at the end of the game?