package main.java.author.view.tabs.terrain;

import java.awt.Color;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map;

public enum TerrainAttribute {

	Walkable      { Color getColor() { return Color.GREEN;}
	                     int getIndex()   { return 10; }},
	                     
	Flyable       { Color getColor() { return Color.BLUE; }
	                     int getIndex()   { return 11; }},
	 
	Untraversable { Color getColor() { return Color.RED; }
	                int getIndex() { return 12; }},

	Entry         { Color getColor() { return Color.MAGENTA; }
	                int getIndex() {  return 13; }},
	                
	Exit          { Color getColor() { return Color.ORANGE; }
	                int getIndex() { return 14;}};

	
	private static Map<Integer, TerrainAttribute> enumMap = 
				new HashMap<Integer, TerrainAttribute>();
	
	static {
		for (TerrainAttribute attr : values()) {
			enumMap.put(attr.getIndex(), attr);
		}
	}
			
	
	@Override
	public String toString() {
		return this.name();
	}
	
	public static TerrainAttribute getAttribute(int i){ 
		return enumMap.get(i);
	} 
	
	abstract Color getColor();
	
	abstract int getIndex();
	
}

@@ -180,24 +180,34 @@
 kable      %7B
+ @Override
  Color getCo
@@ -236,36 +236,29 @@
 REEN;%7D%0A%09
-                    
+%09%09%09%09@Override
  int get
@@ -256,34 +256,32 @@
 e int getIndex()
-  
  %7B return 10; %7D%7D
@@ -282,38 +282,16 @@
 10; %7D%7D,%0A
-%09                     
 %0A%09Flyabl
@@ -291,32 +291,42 @@
 %09Flyable       %7B
+ @Override
  Color getColor(
@@ -351,36 +351,29 @@
 LUE; %7D%0A%09
-                    
+%09%09%09%09@Override
  int get
@@ -379,18 +379,16 @@
 tIndex()
-  
  %7B retur
@@ -397,18 +397,16 @@
 11; %7D%7D,%0A
-%09 
 %0A%09Untrav
@@ -414,16 +414,26 @@
 rsable %7B
+ @Override
  Color g
@@ -461,39 +461,37 @@
 lor.RED; %7D%0A%09
-               
+%09%09%09%09@Override
  int getInde
@@ -520,32 +520,42 @@
 %09Entry         %7B
+ @Override
  Color getColor(
@@ -579,39 +579,37 @@
 MAGENTA; %7D%0A%09
-               
+%09%09%09%09@Override
  int getInde
@@ -630,33 +630,16 @@
 13; %7D%7D,%0A
-%09                
 %0A%09Exit  
@@ -647,16 +647,26 @@
        %7B
+ @Override
  Color g
@@ -701,31 +701,29 @@
 NGE; %7D%0A%09
-               
+%09%09%09%09@Override
  int get
@@ -746,13 +746,18 @@
  14;
+ 
 %7D%7D;%0A%0A
+%09%09%09%09
 %09%0A%09p
@@ -815,17 +815,16 @@
 p = %0A%09%09%09
-%09
 new Hash
@@ -857,17 +857,16 @@
 ute%3E();%0A
-%09
 %0A%09static
@@ -957,21 +957,16 @@
 %0A%09%09%7D%0A%09%7D%0A
-%09%09%09%0A%09
 %0A%09@Overr
@@ -1022,17 +1022,16 @@
 e();%0A%09%7D%0A
-%09
 %0A%09public
@@ -1110,39 +1110,228 @@
 %09%7D %0A
-%09%0A%09abstract Color getColor();%0A%09
+%0A%09/**%0A%09 * Specifies the color that will be displayed in the Terrain View%0A%09 * when the specific attribute is added to a Tile%0A%09 */%0A%09abstract Color getColor();%0A%0A%09/**%0A%09 * Specifies the collision ID of a TerrainAttribute%0A%09 */
 %0A%09ab
@@ -1353,12 +1353,11 @@
 ndex();%0A
-%09
 %0A%7D%0A

update terrain attr with documentation