public int getIntValue(GameTypes.UnitStatType stype) { //Debug.Log(mIntValueMap.Count+" "+mValueMap.Count); if (mIntValueMap.ContainsKey(stype)) { return(mIntValueMap[stype]); } else { //Debug.LogError("The given UnitStatsType ("+stype.ToString()+") is not in the dictionary of types and values."); return(0); } }
public float getValue(GameTypes.UnitStatType stype) { if (mValueMap.ContainsKey(stype)) { return(mValueMap[stype]); } else if (mIntValueMap.ContainsKey(stype)) { return((float)mIntValueMap[stype]); } else { Debug.LogError("The given UnitStatsType is not in the dictionary of types and values."); return(0f); } }
public void addToValue(GameTypes.UnitStatType stype, int cval) { if (mValueMap.ContainsKey(stype)) { mValueMap[stype] = mValueMap[stype] + (float)cval; } else if (mIntValueMap.ContainsKey(stype)) { mIntValueMap[stype] = mIntValueMap[stype] + cval; } else { Debug.LogError("The given UnitStatsType is not in the dictionary of types and values."); return; } }
public void setValue(GameTypes.UnitStatType stype, int val) { mIntValueMap[stype] = val; }
public void setValue(GameTypes.UnitStatType stype, float val) { mValueMap[stype] = val; }
public void addToStat(GameTypes.UnitStatType stype, int cval) { //add a value to the unit stats, use a minus to subtract. mStats.addToValue(stype, cval); }