00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 package com.realtime.crossfire.jxclient.stats;
00023
00024 import java.util.HashMap;
00025 import java.util.Map;
00026 import org.jetbrains.annotations.NotNull;
00027
00032 public class StatsParser {
00033
00038 @NotNull
00039 private static final Map<String, Integer> STAT_TABLE = new HashMap<String, Integer>();
00040
00041 static {
00042 STAT_TABLE.put("AC", Stats.CS_STAT_AC);
00043 STAT_TABLE.put("ARM", Stats.CS_STAT_ARMOUR);
00044 STAT_TABLE.put("CHA", Stats.CS_STAT_CHA);
00045 STAT_TABLE.put("CHA_APPLIED", Stats.CS_STAT_APPLIED_CHA);
00046 STAT_TABLE.put("CHA_BASE", Stats.CS_STAT_BASE_CHA);
00047 STAT_TABLE.put("CHA_RACE", Stats.CS_STAT_RACE_CHA);
00048 STAT_TABLE.put("CON", Stats.CS_STAT_CON);
00049 STAT_TABLE.put("CON_APPLIED", Stats.CS_STAT_APPLIED_CON);
00050 STAT_TABLE.put("CON_BASE", Stats.CS_STAT_BASE_CON);
00051 STAT_TABLE.put("CON_RACE", Stats.CS_STAT_RACE_CON);
00052 STAT_TABLE.put("DAM", Stats.CS_STAT_DAM);
00053 STAT_TABLE.put("DEX", Stats.CS_STAT_DEX);
00054 STAT_TABLE.put("DEX_APPLIED", Stats.CS_STAT_APPLIED_DEX);
00055 STAT_TABLE.put("DEX_BASE", Stats.CS_STAT_BASE_DEX);
00056 STAT_TABLE.put("DEX_RACE", Stats.CS_STAT_RACE_DEX);
00057 STAT_TABLE.put("EXP", Stats.CS_STAT_EXP64);
00058 STAT_TABLE.put("EXP_NEXT_LEVEL", Stats.C_STAT_EXP_NEXT_LEVEL);
00059 STAT_TABLE.put("FOOD", Stats.CS_STAT_FOOD);
00060 STAT_TABLE.put("GOLEM_HP", Stats.CS_STAT_GOLEM_HP);
00061 STAT_TABLE.put("GRACE", Stats.CS_STAT_GRACE);
00062 STAT_TABLE.put("HP", Stats.CS_STAT_HP);
00063 STAT_TABLE.put("INT", Stats.CS_STAT_INT);
00064 STAT_TABLE.put("INT_APPLIED", Stats.CS_STAT_APPLIED_INT);
00065 STAT_TABLE.put("INT_BASE", Stats.CS_STAT_BASE_INT);
00066 STAT_TABLE.put("INT_RACE", Stats.CS_STAT_RACE_INT);
00067 STAT_TABLE.put("LEVEL", Stats.CS_STAT_LEVEL);
00068 STAT_TABLE.put("LOWFOOD", Stats.C_STAT_LOWFOOD);
00069 STAT_TABLE.put("POISONED", Stats.C_STAT_POISONED);
00070 STAT_TABLE.put("POW", Stats.CS_STAT_POW);
00071 STAT_TABLE.put("POW_APPLIED", Stats.CS_STAT_APPLIED_POW);
00072 STAT_TABLE.put("POW_BASE", Stats.CS_STAT_BASE_POW);
00073 STAT_TABLE.put("POW_RACE", Stats.CS_STAT_RACE_POW);
00074 STAT_TABLE.put("RANGE", Stats.CS_STAT_RANGE);
00075 STAT_TABLE.put("RES_ACID", Stats.CS_STAT_RES_ACID);
00076 STAT_TABLE.put("RES_BLIND", Stats.CS_STAT_RES_BLIND);
00077 STAT_TABLE.put("RES_COLD", Stats.CS_STAT_RES_COLD);
00078 STAT_TABLE.put("RES_CONF", Stats.CS_STAT_RES_CONF);
00079 STAT_TABLE.put("RES_DEATH", Stats.CS_STAT_RES_DEATH);
00080 STAT_TABLE.put("RES_DEPLETE", Stats.CS_STAT_RES_DEPLETE);
00081 STAT_TABLE.put("RES_DRAIN", Stats.CS_STAT_RES_DRAIN);
00082 STAT_TABLE.put("RES_ELEC", Stats.CS_STAT_RES_ELEC);
00083 STAT_TABLE.put("RES_FEAR", Stats.CS_STAT_RES_FEAR);
00084 STAT_TABLE.put("RES_FIRE", Stats.CS_STAT_RES_FIRE);
00085 STAT_TABLE.put("RES_GHOSTHIT", Stats.CS_STAT_RES_GHOSTHIT);
00086 STAT_TABLE.put("RES_HOLYWORD", Stats.CS_STAT_RES_HOLYWORD);
00087 STAT_TABLE.put("RES_MAG", Stats.CS_STAT_RES_MAG);
00088 STAT_TABLE.put("RES_PARA", Stats.CS_STAT_RES_PARA);
00089 STAT_TABLE.put("RES_PHYS", Stats.CS_STAT_RES_PHYS);
00090 STAT_TABLE.put("RES_POISON", Stats.CS_STAT_RES_POISON);
00091 STAT_TABLE.put("RES_SLOW", Stats.CS_STAT_RES_SLOW);
00092 STAT_TABLE.put("RES_TURN_UNDEAD", Stats.CS_STAT_RES_TURN_UNDEAD);
00093 STAT_TABLE.put("SP", Stats.CS_STAT_SP);
00094 STAT_TABLE.put("SPEED", Stats.CS_STAT_SPEED);
00095 STAT_TABLE.put("STR", Stats.CS_STAT_STR);
00096 STAT_TABLE.put("STR_APPLIED", Stats.CS_STAT_APPLIED_STR);
00097 STAT_TABLE.put("STR_BASE", Stats.CS_STAT_BASE_STR);
00098 STAT_TABLE.put("STR_RACE", Stats.CS_STAT_RACE_STR);
00099 STAT_TABLE.put("TITLE", Stats.CS_STAT_TITLE);
00100 STAT_TABLE.put("WC", Stats.CS_STAT_WC);
00101 STAT_TABLE.put("WEIGHT", Stats.C_STAT_WEIGHT);
00102 STAT_TABLE.put("WEIGHT_LIMIT", Stats.CS_STAT_WEIGHT_LIM);
00103 STAT_TABLE.put("WIS", Stats.CS_STAT_WIS);
00104 STAT_TABLE.put("WIS_APPLIED", Stats.CS_STAT_APPLIED_WIS);
00105 STAT_TABLE.put("WIS_BASE", Stats.CS_STAT_BASE_WIS);
00106 STAT_TABLE.put("WIS_RACE", Stats.CS_STAT_RACE_WIS);
00107 STAT_TABLE.put("WEAPON_SPEED", Stats.CS_STAT_WEAP_SP);
00108 }
00109
00113 private StatsParser() {
00114 }
00115
00122 public static int parseStat(@NotNull final String name) {
00123 if (!STAT_TABLE.containsKey(name)) {
00124 throw new IllegalArgumentException();
00125 }
00126
00127 return STAT_TABLE.get(name);
00128 }
00129
00130 }