@Test public void testMorePointsGameResultEvaluator() throws Exception { MorePointsGameResultEvaluator evaluator = new MorePointsGameResultEvaluator(10, -10, 3); { GameOutcome outcome = evaluator.evaluate(300, 100); GameOutcome expected = new GameOutcome(10, -10); Assert.assertEquals(expected, outcome); } { GameOutcome outcome = evaluator.evaluate(99, 100); GameOutcome expected = new GameOutcome(-10, 10); Assert.assertEquals(expected, outcome); } { GameOutcome outcome = evaluator.evaluate(-13, -13); GameOutcome expected = new GameOutcome(3, 3); Assert.assertEquals(expected, outcome); } }
public MorePointsGameResultEvaluator(double pointsForWin, double pointsForLose, double pointsForDraw) { Preconditions.checkArgument(pointsForWin >= pointsForDraw && pointsForDraw >= pointsForLose); Preconditions.checkArgument(pointsForWin > pointsForLose); this.pointsForWin = pointsForWin; this.pointsForLose = pointsForLose; this.pointsForDraw = pointsForDraw; }
MorePointsGameResultEvaluator implements GameResultEvaluator { public MorePointsGameResultEvaluator(double pointsForWin, double pointsForLose, double pointsForDraw) { Preconditions.checkArgument(pointsForWin >= pointsForDraw && pointsForDraw >= pointsForLose); Preconditions.checkArgument(pointsForWin > pointsForLose); this.pointsForWin = pointsForWin; this.pointsForLose = pointsForLose; this.pointsForDraw = pointsForDraw; } }
MorePointsGameResultEvaluator implements GameResultEvaluator { public MorePointsGameResultEvaluator(double pointsForWin, double pointsForLose, double pointsForDraw) { Preconditions.checkArgument(pointsForWin >= pointsForDraw && pointsForDraw >= pointsForLose); Preconditions.checkArgument(pointsForWin > pointsForLose); this.pointsForWin = pointsForWin; this.pointsForLose = pointsForLose; this.pointsForDraw = pointsForDraw; } MorePointsGameResultEvaluator(double pointsForWin, double pointsForLose, double pointsForDraw);  MorePointsGameResultEvaluator(); }
MorePointsGameResultEvaluator implements GameResultEvaluator { public MorePointsGameResultEvaluator(double pointsForWin, double pointsForLose, double pointsForDraw) { Preconditions.checkArgument(pointsForWin >= pointsForDraw && pointsForDraw >= pointsForLose); Preconditions.checkArgument(pointsForWin > pointsForLose); this.pointsForWin = pointsForWin; this.pointsForLose = pointsForLose; this.pointsForDraw = pointsForDraw; } MorePointsGameResultEvaluator(double pointsForWin, double pointsForLose, double pointsForDraw);  MorePointsGameResultEvaluator(); @Override GameOutcome evaluate(double firstPlayerPoints, double secondPlayerPoints); @Override String toString(); }
MorePointsGameResultEvaluator implements GameResultEvaluator { public MorePointsGameResultEvaluator(double pointsForWin, double pointsForLose, double pointsForDraw) { Preconditions.checkArgument(pointsForWin >= pointsForDraw && pointsForDraw >= pointsForLose); Preconditions.checkArgument(pointsForWin > pointsForLose); this.pointsForWin = pointsForWin; this.pointsForLose = pointsForLose; this.pointsForDraw = pointsForDraw; } MorePointsGameResultEvaluator(double pointsForWin, double pointsForLose, double pointsForDraw);  MorePointsGameResultEvaluator(); @Override GameOutcome evaluate(double firstPlayerPoints, double secondPlayerPoints); @Override String toString();  }