@@ -0,0 +1,686 @@
+package eco.game;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collections;%0A%0Apublic class RandTexture %7B%0A%09%0A%09/**%0A%09 * A class that uses hashcodes to pick random textures for%0A%09 * different locations%0A%09 * %0A%09 */%0A%09%0A%09private ArrayList%3CPoint%3E textures = new ArrayList%3CPoint%3E();%0A%09%0A%09public void addTexture(Point texture)%7B%0A%09%09textures.add(texture);%0A%09%09Collections.shuffle(textures);%0A%09%7D%0A%09%0A%09public Point sample(int x, int y)%7B%0A%09%09x = Math.abs(x);%0A%09%09y = Math.abs(y);%0A%09%09int hash = 7;%0A%09    hash = 71 * hash + x;%0A%09    hash = 71 * hash + y;%0A%09    hash %25= 100;%0A%09%09int numtex = textures.size();%0A%09%09float temp = hash;%0A%09%09temp /= (100);%0A%09    temp *= numtex;%0A%09    hash = (int) temp;%0A%09%09return textures.get(hash);%0A%09%7D%0A%0A%7D%0A

Create RandTexture.java