summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <lekensteyn@gmail.com>2013-11-29 00:33:58 +0100
committerPeter Wu <lekensteyn@gmail.com>2013-11-29 00:33:58 +0100
commit7604a15a1797f51a78132fc0ffbdc95a857d77c8 (patch)
treedd78ecd45c6a5d221db3cf2364641fabbe45dd2a
parenta94168139e5ce62db34ee7ed49dd72e2dd7fb1de (diff)
download2iv60-robots-7604a15a1797f51a78132fc0ffbdc95a857d77c8.tar.gz
Refactor: move Material outside RobotRace
-rw-r--r--src/Material.java51
-rw-r--r--src/RobotRace.java51
2 files changed, 51 insertions, 51 deletions
diff --git a/src/Material.java b/src/Material.java
new file mode 100644
index 0000000..1968e7f
--- /dev/null
+++ b/src/Material.java
@@ -0,0 +1,51 @@
+/**
+ * Materials that can be used for the robots.
+ */
+public enum Material {
+
+ /**
+ * Gold material properties.
+ * Modify the default values to make it look like gold.
+ */
+ GOLD (
+ new float[] {0.8f, 0.8f, 0.8f, 1.0f},
+ new float[] {0.0f, 0.0f, 0.0f, 1.0f}),
+
+ /**
+ * Silver material properties.
+ * Modify the default values to make it look like silver.
+ */
+ SILVER (
+ new float[] {0.8f, 0.8f, 0.8f, 1.0f},
+ new float[] {0.0f, 0.0f, 0.0f, 1.0f}),
+
+ /**
+ * Wood material properties.
+ * Modify the default values to make it look like wood.
+ */
+ WOOD (
+ new float[] {0.8f, 0.8f, 0.8f, 1.0f},
+ new float[] {0.0f, 0.0f, 0.0f, 1.0f}),
+
+ /**
+ * Orange material properties.
+ * Modify the default values to make it look like orange.
+ */
+ ORANGE (
+ new float[] {0.8f, 0.8f, 0.8f, 1.0f},
+ new float[] {0.0f, 0.0f, 0.0f, 1.0f});
+
+ /** The diffuse RGBA reflectance of the material. */
+ float[] diffuse;
+
+ /** The specular RGBA reflectance of the material. */
+ float[] specular;
+
+ /**
+ * Constructs a new material with diffuse and specular properties.
+ */
+ private Material(float[] diffuse, float[] specular) {
+ this.diffuse = diffuse;
+ this.specular = specular;
+ }
+}
diff --git a/src/RobotRace.java b/src/RobotRace.java
index f064de8..61edd34 100644
--- a/src/RobotRace.java
+++ b/src/RobotRace.java
@@ -286,57 +286,6 @@ public class RobotRace extends Base {
}
/**
- * Materials that can be used for the robots.
- */
- public enum Material {
-
- /**
- * Gold material properties.
- * Modify the default values to make it look like gold.
- */
- GOLD (
- new float[] {0.8f, 0.8f, 0.8f, 1.0f},
- new float[] {0.0f, 0.0f, 0.0f, 1.0f}),
-
- /**
- * Silver material properties.
- * Modify the default values to make it look like silver.
- */
- SILVER (
- new float[] {0.8f, 0.8f, 0.8f, 1.0f},
- new float[] {0.0f, 0.0f, 0.0f, 1.0f}),
-
- /**
- * Wood material properties.
- * Modify the default values to make it look like wood.
- */
- WOOD (
- new float[] {0.8f, 0.8f, 0.8f, 1.0f},
- new float[] {0.0f, 0.0f, 0.0f, 1.0f}),
-
- /**
- * Orange material properties.
- * Modify the default values to make it look like orange.
- */
- ORANGE (
- new float[] {0.8f, 0.8f, 0.8f, 1.0f},
- new float[] {0.0f, 0.0f, 0.0f, 1.0f});
-
- /** The diffuse RGBA reflectance of the material. */
- float[] diffuse;
-
- /** The specular RGBA reflectance of the material. */
- float[] specular;
-
- /**
- * Constructs a new material with diffuse and specular properties.
- */
- private Material(float[] diffuse, float[] specular) {
- this.diffuse = diffuse;
- this.specular = specular;
- }
- }
-
* Implementation of a camera with a position and orientation.
*/
private class Camera {