package net.keabotstudios.caritemereBase.game.types;

import java.util.HashSet;
import java.util.Set;

public class Type {
	
	public static final Type UNDEFINED = new Type("NULL", "null (this is an error!)", "physically impossible (this is an error!)", new HashSet<ValidType>());
	
	private final String ID, name, adjective;
	private final Set<ValidType> validTypes;
	
	public Type(String ID, String name, String adjective, Set<ValidType> validTypes) {
		this.ID = ID;
		this.name = name;
		this.adjective = adjective;
		if(validTypes == null)
			throw new IllegalArgumentException("validTypes list cannot be null!");
		this.validTypes = validTypes;
	}
	
	public String getID() {
		return ID;
	}
	
	public String getName() {
		return name;
	}
	
	public String getAdjective() {
		return adjective;
	}
	
	public boolean isValidType(ValidType vt) {
		return validTypes.contains(vt);
	}
	
}

/*

+-----------------------------+
| !OLD SHIT DONNUT USE GUISE! |
| *Here for reference.        |
+-----------------------------+

public enum Type {
	// TODO Finish these up
	UNDEFINED("null", "null", ValidTypes.EVERYTHING),
	HUMAN("human", "human", 0b010000111111),
	EQUINE("equine", "horse-like", ValidTypes.ALL_TYPE),
	BOVINE("bovine", "cow-like", 0b1111111111),
	CANINE("canine", "canine", 0b011000111111),
	FELINE("feline", "feline", BodyPartType.GENITAL, BodyPartType.FACE, BodyPartType.EYE, BodyPartType.EAR),
	//VULPINE("vulpine", "fox-like", BodyPartType.FACE, BodyPartType.EAR),
	BEE("bee", "bee-like", BodyPartType.GENITAL, BodyPartType.FACE, BodyPartType.TOUNGE, BodyPartType.ANTENNAE),
	ARACHNID("arachnid", "spider-like", BodyPartType.GENITAL, BodyPartType.FACE, BodyPartType.EYE, BodyPartType.EAR, BodyPartType.LEGS),
	//LAPINE("lapine", "rabbit-like", BodyPartType.FACE),
	//AVIAN("avian", "bird-like", BodyPartType.FACE, BodyPartType.EAR),
	DRACONIC("draconic", "draconic", BodyPartType.GENITAL, BodyPartType.FACE, BodyPartType.TOUNGE, BodyPartType.EAR, BodyPartType.HORNS),
	LIZIAN("lizian", "lizard-like", BodyPartType.GENITAL, BodyPartType.FACE, BodyPartType.EAR),
	SNAKE("snake", "snake-like", BodyPartType.GENITAL, BodyPartType.EYE, BodyPartType.TOUNGE, BodyPartType.EAR, BodyPartType.LEGS),
	CENTAUR("centuar", BodyPartType.GENITAL),
	FROG("frog", "frog-like", BodyPartType.FACE, BodyPartType.EYE, BodyPartType.TOUNGE, BodyPartType.EAR),
	DEMONIC("demonic", "demonic", BodyPartType.LEGS, BodyPartType.EYE, BodyPartType.TOUNGE),
	GOOEY("gooey", "gooey", BodyPartType.GENITAL, BodyPartType.TOUNGE),
	KANGAROO("kangaroo", "kangaroo-like", BodyPartType.FACE, BodyPartType.EAR),
	TANUKI("tanuki", "tanuki-like"),
	SHARK("shark", "shark-like", BodyPartType.FACE, BodyPartType.EAR),
	CERVINE("deer", "deer-like", BodyPartType.FACE, BodyPartType.EAR),
	ANEMONE("anemone", "anemone"),
	TENTACLE("tentacle", "tentacle", BodyPartType.TOUNGE),
	MOUSE("mouse", "mouse-like", BodyPartType.FACE, BodyPartType.EAR),
	DRAGONFLY("dragonfly", "dragonfly-like"),
	PANDA("panda", "panda-like", BodyPartType.FACE, BodyPartType.EAR),
	BADGER("badger", "badger-like", BodyPartType.FACE, BodyPartType.EAR),
	GOAT("goat", "goat-like", BodyPartType.FACE, BodyPartType.EYE, BodyPartType.EAR),
	SYNTHETIC("synthetic", "synthetic", BodyPartType.EYE),
	INHUMAN("inhuman", "inhuman"),
	ELF("elf", "elven", BodyPartType.FACE, BodyPartType.EAR),
	DARK_ELF("dark elf", "elven", BodyPartType.FACE, BodyPartType.EAR),
	RHINO("rhino", "rhino-like", BodyPartType.FACE, BodyPartType.EAR),
	PLANT("plant", "plant-like", BodyPartType.GENITAL),
	PIG("pig", "pig-like", BodyPartType.FACE, BodyPartType.EAR),
	MOUTHGINA("mouthgina", "mouth-like", BodyPartType.GENITAL),
	LUPINE("lupine", "rabbit-like", BodyPartType.FACE, BodyPartType.EAR),
	SHEEP("sheep", "sheep-like", BodyPartType.FACE, BodyPartType.EYE, BodyPartType.TOUNGE, BodyPartType.EAR),
	REDPANDA("red panda", "panda-like", BodyPartType.FACE, BodyPartType.EAR);

	private static final String VOWELS = "aeiou";

	private String name, adjective, article;
	private ArrayList<Boolean> validTypes;
	
	private Type(String name, String adjective, int typeFlags) {
		this.name = name;
		this.adjective = adjective;
		this.article = (VOWELS.contains(this.name().substring(0, 1))) ? "an" : "a";
		this.validTypes = new ArrayList<Boolean>();
		for(int i = 0; i < ValidTypes.NUM_FLAGS; i++) {
			int mask = (int) Math.pow(2, i);
			validTypes.add((typeFlags & mask) > 0);
		}
	}

	public boolean isValidType(int i) {
		return this.validTypes.get(i);
	}

	public String getName() {
		return name;
	}

	public String getAdjective() {
		return adjective;
	}

	public String getArticle() {
		return article;
	}
}
*/