public object GetModuleValue(ShipModuleValue valueType) { string temp = valueType.ToString(); if (temp[1] != '_') { return(Values[valueType]); } else { if (temp[0] == 'I') { return((int)Values[valueType]); } else { return((int)Values[valueType] == 0 ? false : true); } } }
public void SetModuleValue(ShipModuleValue valueType, float value) { string temp = valueType.ToString(); if (temp[1] != '_') { Values[valueType] += value; } else { int tempValue = (int)value; if (temp[0] == 'I') { Values[valueType] += (float)tempValue; } else { Values[valueType] = tempValue != 0 || tempValue != 1 ? 0f : value; } } }