コード例 #1
0
ファイル: TaskFactoryTest.java プロジェクト: dcbr/HillBillies
  @Test
  public void createBoulderPosition() throws Exception {
    Statement p = new Print(f.createBoulderPosition(null));

    new Boulder(w, w.getCube(new Vector(1, 0, 0)));

    runStatementFor(u, p, 0.2);
    System.out.println("The above should print (1,0,0)");

    // Check whether task successfully finished
    assertEquals(null, u.getTask());
    assertEquals(0, u.getFaction().getScheduler().getNbTasks());
  }
コード例 #2
0
ファイル: TaskFactoryTest.java プロジェクト: dcbr/HillBillies
  @Test
  public void createWork() throws Exception {
    Statement work = f.createWork(new LiteralPosition(1, 0, 0), null);

    new Boulder(w, w.getCube(new Vector(1, 0, 0)));

    runStatementFor(u, work, 1 + 500 / u.getStrength());

    // Check whether task successfully finished
    assertEquals(null, u.getTask());
    assertEquals(0, u.getFaction().getScheduler().getNbTasks());
    assertTrue(u.isCarryingBoulder());
  }