コード例 #1
0
 void testHelper(Position position, Velocity velocity, Tester stepTest) {
   DummyPhysics physics = new DummyPhysics();
   physics.createGoalpost(Direction.NORTH);
   physics.createGoalpost(Direction.SOUTH);
   Ball ball = physics.createBall();
   ball.setPosition(position);
   ball.setVelocity(velocity);
   for (int i = 0; i < 1000; i++) {
     physics.step(dt);
     stepTest.test(ball.getPosition(), ball.getVelocity());
   }
   physics.clean();
 }