Fixed parrot again.

This commit is contained in:
Calum
2017-09-28 14:46:55 +13:00
parent 597fbe935f
commit 1e19dd5ab6
4 changed files with 29 additions and 20 deletions
@@ -13,7 +13,7 @@ public enum BoatMeshType {
PIRATE_SHIP("pirateship_hull.stl", "pirateship_mast.stl", -0.5415, "pirateship_mainsail.stl",
-0.5415, "pirateship_frontsail.stl", true, 1.2, 1.6, 1.2),
DUCKY("ducky_hull.stl", "ducky_mast.stl", -2.18539, "ducky_sail.stl", -2.18539, "ducky_eyes.stl", false, 1.2, 1.1, 1.4),
PARROT("parrot_hull.stl", null, 0, "parrot_sail.stl", 0, "parrot_features.stl", true, 1, 1, 1),
PARROT("parrot_hull.stl", null, 0, "parrot_features.stl", 0, "parrot_sail.stl", true, 1, 1, 1),
WAKA("waka_hull.stl", "waka_mast.stl", 0, "waka_sail.stl", 0, null, true, 1.7, 0.5, 1.5);
final String hullFile, mastFile, sailFile, jibFile;
@@ -100,19 +100,19 @@ public class ModelFactory {
mast.setMaterial(new PhongMaterial(primaryColour));
boatAssets.getChildren().add(mast);
} else {
boatAssets.getChildren().add(new Group());
boatAssets.getChildren().add(new MeshView());
}
MeshView sail = importBoatSTL(boatType.sailFile);
sail.setMaterial(
new PhongMaterial(boatType == BoatMeshType.PARROT ? Color.DARKGRAY : Color.WHITE)
new PhongMaterial(boatType == BoatMeshType.PARROT ? Color.BLACK : Color.WHITE)
);
boatAssets.getChildren().add(sail);
if (boatType.jibFile != null) {
MeshView jib = importBoatSTL(boatType.jibFile);
jib.setMaterial(
new PhongMaterial(boatType == BoatMeshType.PARROT ? Color.BLACK : Color.WHITE)
new PhongMaterial(boatType == BoatMeshType.PARROT ? Color.DARKGRAY : Color.WHITE)
);
boatAssets.getChildren().add(jib);
}
@@ -0,0 +1,9 @@
package seng302.utilities;
/**
* Created by cir27 on 28/09/17.
*/
public class MapMakerTest {
// @Test
}
+16 -16
View File
@@ -16,26 +16,26 @@ public class CustomMapsSteps {
@Given("^that the game has multiple race xml files$")
public void that_the_game_has_multiple_race_xml_files() throws Throwable {
// mapMaker = MapMaker.getInstance();
// String firstMap = mapMaker.getCurrentRacePath();
// int numMaps = 0;
// do {
// mapMaker.next();
// numMaps++;
// } while (!mapMaker.getCurrentRacePath().equals(firstMap));
// Assert.assertTrue(numMaps >= 2);
mapMaker = MapMaker.getInstance();
String firstMap = mapMaker.getCurrentRacePath();
int numMaps = 0;
do {
mapMaker.next();
numMaps++;
} while (!mapMaker.getCurrentRacePath().equals(firstMap));
Assert.assertTrue(numMaps >= 2);
}
@Then("^all of them can be seen$")
public void all_of_them_can_be_seen() throws Throwable {
// File[] files = new File(this.getClass().getResource("/maps/").getPath()).listFiles();
// for (File file : files) {
// if (file.isFile()) {
// Assert.assertTrue(file.getAbsolutePath().equals(mapMaker.getCurrentRacePath()));
// mapMaker.next();
// System.out.println(file.getAbsolutePath());
// }
// }
File[] files = new File(this.getClass().getResource("/maps/").getPath()).listFiles();
for (File file : files) {
if (file.isFile()) {
Assert.assertTrue(file.getAbsolutePath().equals(mapMaker.getCurrentRacePath()));
mapMaker.next();
System.out.println(file.getAbsolutePath());
}
}
}
@Given("^that I choose a race$")