void PhosimParser::get(const std::string & key, double & value) const {
     try {
         value = dfloat(key);
     } catch (PhosimParserException & eObj) {
         // do nothing
     }
 }
Beispiel #2
0
    bool set(Type numValue)
    {
        DENG2_ASSERT(type == Int || type == UInt || type == Float);

        switch(type)
        {
        case Int:
            if(value.int32 != dint(numValue))
            {
                value.int32 = dint(numValue);
                return true;
            }
            break;

        case UInt:
            if(value.uint32 != duint(numValue))
            {
                value.uint32 = duint(numValue);
                return true;
            }
            break;

        case Float:
            if(!fequal(value.float32, dfloat(numValue)))
            {
                value.float32 = dfloat(numValue);
                return true;
            }
            break;

        default:
            break;
        }

        return false;
    }