package net.minecraft.src.weasel.obj;

import java.util.ArrayList;


/**
 * Type of a Weasel data object
 * 
 * @author MightyPork
 * @copy (c) 2012
 */
@SuppressWarnings("javadoc") 
public enum WeaselObjectType {

	BOOLEAN,INTEGER,STRING,VARIABLE_LIST,STACK;

	
	private WeaselObjectType() {
		setup();
	}
	
	private static int counter = 1;
	private static ArrayList<WeaselObjectType> members;

	static {
		members = new ArrayList<WeaselObjectType>();
		members.add(null);
	}
	
	private void setup() {			
		index = counter++;
		members.add(this);
	}
	
	/**
	 * Get enum type for type index
	 * 
	 * @param index type index
	 * @return corresponding enum type
	 */
	public static WeaselObjectType getTypeFromIndex(int index) {
		return members.get(index);
	}

	/** enum index */
	public int index;
}
