import java.util.*;

public class Race {

protected String name;
protected char environtype;
protected int strength;
protected int endurance;
protected boolean isHandtohand;
protected boolean isStarFaring;
protected int[] homeworld;

/**
 * Constructor Method
 * @param newname Race Name
 * @param newtype Environ Type
 * @param newstren Strength
 * @param newendur Endurance
 * @param ctype Is Hand to Hand Creature
 * @param isSF Is Star Faring
 * @param newarray Array of Homeworlds
 */

public Race (String newname, char newtype, int newstren, int newendur, boolean ctype, boolean isSF, int[] newarray)
 {
  name = newname;
  environtype = newtype;
  strength = newstren;
  endurance = newendur;
  isHandtohand = ctype;
  isStarFaring = isSF;
  homeworld = newarray;
 }

static Race AllRaces[];
static Hashtable RaceHash; 
/**
 * accessor methods
 */

/** get(String)
 * returns the race of the same name
 * @param Name Race's name
 * @return Race
 */

public static Race get(String Name)
{
   return (Race)RaceHash.get(Name);
}

/** getName()
 * returns the name of a race
 * @return Race's name
 */

public String getName()
 {
  return name;
 }

/** getEnvirontype()
 * returns the environ type of a race
 * @return Race's Environ Type
 */

public char getEnvirontype()
 {
  return environtype;
 }

/** getStrength()
 * returns the strength of a race
 * @return Race's Strength Rating
 */

public int getStrength()
 {
  return strength;
 }

/** getEndurance()
 * returns the endurance of a race
 * @return Race's Endurance Rating
 */

public int getEndurance()
 {
  return endurance;
 }

/** getisHandtohand()
 * returns if the race fights hand to hand in combat
 * @return True - Hand to Hand Combat, False - Fire Fight
 */

public boolean getisHandtohand()
 {
  return isHandtohand;
 }

/** getisStarFaring()
 * returns if the race is starfaring
 * @return True - StarFaring Race
 */

public boolean getisStarFaring()
 {
  return isStarFaring;
 }

/**
  * Init()
  * Initializer of all races in FITG
*/

public static void init()
 {
  int[] empty = {};
  int[] KaynsHW = {111, 121, 212, 551};
  int[] PioradsHW = {451,141,232,432,433,442};
  int[] RhonesHW = {112,142,151,152,161,162,231,241,311,323,342,411,421,523,542};
  int[] SauriansHW = {521,121,143,151,163,221,331,352};
  int[] SegundensHW = {122,131,232,421,521};
  int[] SuvansHW = {351,113,241,341,342};
  int[] XanthonsHW = {513,143,522,531};
  int[] YestersHW = {211,112,222,223,231,312};

  AllRaces = new Race[47];
  RaceHash = new Hashtable();
  
  AllRaces[0] = new Race("Anons",'A',4,2,true,false,empty);
  AllRaces[1] = new Race("Ardorats",'W',4,4,false,false,empty);
  AllRaces[2] = new Race("Borks",'W',8,2,false,false,empty);
  AllRaces[3] = new Race("Calmas",'S',5,4,false,false,empty);
  AllRaces[4] = new Race("Charkhans",'W',5,4,false,false,empty);
  AllRaces[5] = new Race("Cavalkus",'A',4,3,true,false,empty);
  AllRaces[6] = new Race("Deaxins",'W',5,5,true,false,empty);
  AllRaces[7] = new Race("Henones",'L',6,6,false,false,empty);
  AllRaces[8] = new Race("Illias",'W',4,4,false,false,empty);
  AllRaces[9] = new Race("Jopers",'U',6,2,false,false,empty);
  AllRaces[10] = new Race("Kayns_W",'W',7,6,false,true,KaynsHW);
  AllRaces[11] = new Race("Kayns_S",'S',6,4,false,true,KaynsHW);
  AllRaces[12] = new Race("Kirts",'W',5,4,false,false,empty);
  AllRaces[13] = new Race("Leonids",'W',6,4,false,false,empty);
  AllRaces[14] = new Race("Moghas",'W',7,3,true,false,empty);
  AllRaces[15] = new Race("Mowevs",'W',4,4,false,false,empty);
  AllRaces[16] = new Race("Mutant_A",'A',8,8,true,false,empty);
  AllRaces[17] = new Race("Mutant_S",'S',8,8,true,false,empty);
  AllRaces[18] = new Race("Mutant_U",'U',8,8,true,false,empty);
  AllRaces[19] = new Race("Mutant_W",'W',8,8,true,false,empty);
  AllRaces[20] = new Race("Mutant_F",'F',8,8,true,false,empty);
  AllRaces[21] = new Race("Mutant_L",'L',8,8,true,false,empty);
  AllRaces[22] = new Race("Ornotins",'U',6,4,false,false,empty);
  AllRaces[23] = new Race("Phans",'L',4,4,false,false,empty);
  AllRaces[24] = new Race("Piorads_U",'U',4,4,false,true,PioradsHW);
  AllRaces[25] = new Race("Piorads_S",'S',6,6,false,true,PioradsHW);
  AllRaces[26] = new Race("Rhones_U",'U',5,4,false,true,RhonesHW);
  AllRaces[27] = new Race("Rhones_W",'W',4,4,false,true,RhonesHW);
  AllRaces[28] = new Race("Rhones_S",'S',4,4,false,true,RhonesHW);
  AllRaces[29] = new Race("Rylians",'S',8,2,true,false,empty);
  AllRaces[30] = new Race("Saurians_U",'U',5,6,false,true,SauriansHW);
  AllRaces[31] = new Race("Saurians_W",'W',5,4,false,true,SauriansHW);
  AllRaces[32] = new Race("Saurians_S",'S',5,2,false,true,SauriansHW);
  AllRaces[33] = new Race("Saurians_L",'L',5,2,false,true,SauriansHW);
  AllRaces[34] = new Race("Segundens_U",'U',6,4,false,true,SegundensHW);
  AllRaces[35] = new Race("Segundens_L",'L',5,2,false,true,SegundensHW);
  AllRaces[36] = new Race("Susperans",'U',4,4,false,true,SegundensHW);
  AllRaces[37] = new Race("Suvans_U",'U',6,2,false,true,SuvansHW);
  AllRaces[38] = new Race("Suvans_L",'L',7,4,false,true,SuvansHW);
  AllRaces[39] = new Race("Theshians",'W',4,2,false,false,empty);
  AllRaces[40] = new Race("Thoks",'W',6,5,true,false,empty);
  AllRaces[41] = new Race("Ultraks",'U',4,4,false,false,empty);
  AllRaces[42] = new Race("Urgaks",'W',6,4,false,false,empty);
  AllRaces[43] = new Race("Ursi",'W',7,6,true,false,empty);
  AllRaces[44] = new Race("Xanthons",'F',8,6,false,true,XanthonsHW);
  AllRaces[45] = new Race("Yesters_U",'U',6,2,false,true,YestersHW);
  AllRaces[46] = new Race("Yesters_A",'A',6,4,false,true,YestersHW);

  RaceHash.put("Anons",AllRaces[0]);
  RaceHash.put("Ardorats",AllRaces[1]);
  RaceHash.put("Borks",AllRaces[2]);
  RaceHash.put("Calmas",AllRaces[3]);
  RaceHash.put("Charkhans",AllRaces[4]);
  RaceHash.put("Cavalkus",AllRaces[5]);
  RaceHash.put("Deaxins",AllRaces[6]);
  RaceHash.put("Henones",AllRaces[7]);
  RaceHash.put("Illias",AllRaces[8]);
  RaceHash.put("Jopers",AllRaces[9]);
  RaceHash.put("Kayns_W",AllRaces[10]);
  RaceHash.put("Kayns_S",AllRaces[12]);
  RaceHash.put("Kirts",AllRaces[12]);
  RaceHash.put("Leonids",AllRaces[13]);
  RaceHash.put("Moghas",AllRaces[14]);
  RaceHash.put("Mowevs",AllRaces[15]);
  RaceHash.put("Mutant_A",AllRaces[16]);
  RaceHash.put("Mutant_S",AllRaces[17]);
  RaceHash.put("Mutant_U",AllRaces[18]);
  RaceHash.put("Mutant_W",AllRaces[19]);
  RaceHash.put("Mutant_F",AllRaces[20]);
  RaceHash.put("Mutant_L",AllRaces[21]);
  RaceHash.put("Ornotins",AllRaces[22]);
  RaceHash.put("Phans",AllRaces[23]);
  RaceHash.put("Piorads_U",AllRaces[24]);
  RaceHash.put("Piorads_S",AllRaces[25]);
  RaceHash.put("Rhones_U",AllRaces[26]);
  RaceHash.put("Rhones_W",AllRaces[27]);
  RaceHash.put("Rhones_S",AllRaces[28]);
  RaceHash.put("Rylians",AllRaces[29]);
  RaceHash.put("Saurians_U",AllRaces[30]);
  RaceHash.put("Saurians_W",AllRaces[31]);
  RaceHash.put("Saurians_S",AllRaces[32]);
  RaceHash.put("Saurians_L",AllRaces[33]);
  RaceHash.put("Segundens_U",AllRaces[34]);
  RaceHash.put("Segundens_L",AllRaces[35]);
  RaceHash.put("Susperans_U",AllRaces[36]);
  RaceHash.put("Suvans_U",AllRaces[37]);
  RaceHash.put("Suvans_L",AllRaces[38]);
  RaceHash.put("Theshians",AllRaces[39]);
  RaceHash.put("Thoks",AllRaces[40]);
  RaceHash.put("Ultraks",AllRaces[41]);
  RaceHash.put("Urgaks",AllRaces[42]);
  RaceHash.put("Ursi",AllRaces[43]);
  RaceHash.put("Xanthons",AllRaces[44]);
  RaceHash.put("Yesters_U",AllRaces[45]);
  RaceHash.put("Yesters_A",AllRaces[46]);
 }
}
