예제 #1
0
 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);
     }
 }
예제 #2
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);
     }
 }
예제 #3
0
 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;
     }
 }
예제 #4
0
 public void setValue(GameTypes.UnitStatType stype, int val)
 {
     mIntValueMap[stype] = val;
 }
예제 #5
0
 public void setValue(GameTypes.UnitStatType stype, float val)
 {
     mValueMap[stype] = val;
 }
예제 #6
0
 public void addToStat(GameTypes.UnitStatType stype, int cval)
 {
     //add a value to the unit stats, use a minus to subtract.
     mStats.addToValue(stype, cval);
 }