void TangibleObjectImplementation::updateCraftingValues(CraftingValues* values,
		bool firstUpdate) {
	/// I know its kind dirty, but we want generics to have quantities
	/// Without needing their own classes
	if (values->hasProperty("quantity")) {
		setUseCount(values->getCurrentValue("quantity"));
	}

	if (values->hasProperty("charges")) {
		setUseCount(values->getCurrentValue("charges"));
	}

	if (values->hasProperty("charge")) {
		setUseCount(values->getCurrentValue("charge"));
	}
}
int ONVIF::VideoSourceConfiguration::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 5)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 5;
    } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
        if (_id < 5)
            *reinterpret_cast<int*>(_a[0]) = -1;
        _id -= 5;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< QString*>(_v) = token(); break;
        case 1: *reinterpret_cast< QString*>(_v) = name(); break;
        case 2: *reinterpret_cast< int*>(_v) = useCount(); break;
        case 3: *reinterpret_cast< QString*>(_v) = sourceToken(); break;
        case 4: *reinterpret_cast< QRect*>(_v) = bounds(); break;
        default: break;
        }
        _id -= 5;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setToken(*reinterpret_cast< QString*>(_v)); break;
        case 1: setName(*reinterpret_cast< QString*>(_v)); break;
        case 2: setUseCount(*reinterpret_cast< int*>(_v)); break;
        case 3: setSourceToken(*reinterpret_cast< QString*>(_v)); break;
        case 4: setBounds(*reinterpret_cast< QRect*>(_v)); break;
        default: break;
        }
        _id -= 5;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 5;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 5;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 5;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 5;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 5;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 5;
    } else if (_c == QMetaObject::RegisterPropertyMetaType) {
        if (_id < 5)
            *reinterpret_cast<int*>(_a[0]) = -1;
        _id -= 5;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
void DroidComponentImplementation::updateCraftingValues(CraftingValues* values, bool firstUpdate) {
	ComponentImplementation::updateCraftingValues(values, firstUpdate);

	quality = values->getCurrentValue("mechanism_quality");
	durability = values->getCurrentValue("decayrate");
	if (values->hasProperty("droid_count")) {
		setUseCount(values->getCurrentValue("droid_count"));
		surveyDroid = true;
	}
}
Ejemplo n.º 4
0
void ConsumableImplementation::updateCraftingValues(CraftingValues* values, bool firstUpdate) {

	if(firstUpdate) {
		setMaxCondition(values->getCurrentValue("hitpoints"), true);
	}

	if (!isSpice()) {
		if(values->hasProperty("filling")) {

			filling = (fillingMax - fillingMin) * values->getCurrentPercentage("filling") + fillingMin;
			if(values->hasProperty("add_filling"))
				filling *= (1 -(values->getCurrentValue("add_filling") / 100.f));

		}

		//http://www.swgemu.com/archive/scrapbookv51/data/20070126195417/cheffaq2_5.html
		//Containers
		//How do containers work?
		//Containers are required components for all drinks, but you can use any container in that slot. Each container has a multiplier that gets applied to the base quantity of the drink (which is shown in the Food Chart).
		//Small Glass: 1x multiplier (base quantity),Large Glass: 1.5x multiplier
		//Cask: 3x multiplier , Barrel: Unknown (bugged as of 3/30/04).
		//The multiplier is applied after any rounding due to experimentation. So if a drink needs to be experimented to 25% to go from 6 to 7 doses, that point is still when additional doses appear, just with the multiplier. With a large glass, that drink would go from 9 to 10 doses (6 * 1.5 = 9, 7 * 1.5 = 10.5, but it gets rounded down). This makes things tricky when using large glasses. The rounding is done twice, so you'll get some jumpy increases, first from 9 to 10 at 25% quantity, then from 10 to 12 at 50% quantity.
		//The container multiplier also stacks with any BE quantity enhancer. So if you use both a +150 quantity tissue (which gives a 2.5x multiplier) and a cask, the final drink will have 7.5x as many doses as one made with a small glass and without the tissue.
		//T'illa T'ill is the only exception. This appears to be designed as a single-dose item (although why a 10-15% reduction in the food stomach is considered that powerful is beyond me). This will always come out with a single dose no matter what container or BE tissue you include in it, so stick to small glasses.

		if(values->hasProperty("quantity")) {
			int quant = (quantityMax - quantityMin) * values->getCurrentPercentage("quantity") + quantityMin;

			if(values->hasProperty("quantity_bonus"))
				quant *= values->getCurrentValue("quantity_bonus");


			if(values->hasProperty("add_quantity"))
				quant *= (1 + (values->getCurrentValue("add_quantity") / 100.f));

			setUseCount(quant, true);
		}

		if(values->hasProperty("flavor")) {
			duration = (flavorMax - flavorMin) * values->getCurrentPercentage("flavor") + flavorMin;

			if(values->hasProperty("add_flavor"))
				duration *= (1 + (values->getCurrentValue("add_flavor") / 100.f));

		}

		if(values->hasProperty("nutrition")) {
			nutrition = (nutritionMax - nutritionMin) * values->getCurrentPercentage("nutrition") + nutritionMin;

			if(values->hasProperty("add_nutrition"))
				nutrition *= (1 + (values->getCurrentValue("add_nutrition") / 100.f));
		}
	}
}
void FireworkObjectImplementation::updateCraftingValues(CraftingValues* values, bool firstUpdate) {

	ManagedReference<FireworkObject*> firework = _this.getReferenceUnsafeStaticCast();

	if (firework == NULL)
		return;

	DataObjectComponent* data = firework->getDataObjectComponent()->get();

	if (data != NULL && data->isFireworkShowData()) {
		FireworkShowDataComponent* fireworkShowData = cast<FireworkShowDataComponent*>(data);

		if (fireworkShowData == NULL)
			return;

		capacity = values->getCurrentValue("charges");

	} else {
		setUseCount(values->getCurrentValue("charges"));
	}
}
Ejemplo n.º 6
0
int ONVIF::Configuration::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 24)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 24;
    } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
        if (_id < 24)
            *reinterpret_cast<int*>(_a[0]) = -1;
        _id -= 24;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< QString*>(_v) = ptzConfigurationToken(); break;
        case 1: *reinterpret_cast< QString*>(_v) = name(); break;
        case 2: *reinterpret_cast< int*>(_v) = useCount(); break;
        case 3: *reinterpret_cast< QString*>(_v) = nodeToken(); break;
        case 4: *reinterpret_cast< QString*>(_v) = defaultAbsoluteZoomPositionSpace(); break;
        case 5: *reinterpret_cast< QString*>(_v) = defaultRelativePanTiltTranslationSpace(); break;
        case 6: *reinterpret_cast< QString*>(_v) = defaultRelativeZoomTranslationSpace(); break;
        case 7: *reinterpret_cast< QString*>(_v) = defaultContinuousPanTiltVelocitySpace(); break;
        case 8: *reinterpret_cast< QString*>(_v) = defaultContinuousZoomVelocitySpace(); break;
        case 9: *reinterpret_cast< QString*>(_v) = panTiltSpace(); break;
        case 10: *reinterpret_cast< float*>(_v) = panTiltX(); break;
        case 11: *reinterpret_cast< float*>(_v) = panTiltY(); break;
        case 12: *reinterpret_cast< QString*>(_v) = zoomSpace(); break;
        case 13: *reinterpret_cast< float*>(_v) = zoomX(); break;
        case 14: *reinterpret_cast< QString*>(_v) = defaultPTZTimeout(); break;
        case 15: *reinterpret_cast< QString*>(_v) = panTiltUri(); break;
        case 16: *reinterpret_cast< float*>(_v) = panTiltXRangeMin(); break;
        case 17: *reinterpret_cast< float*>(_v) = panTiltXRangeMax(); break;
        case 18: *reinterpret_cast< float*>(_v) = panTiltYRangeMin(); break;
        case 19: *reinterpret_cast< float*>(_v) = panTiltYRangeMax(); break;
        case 20: *reinterpret_cast< QString*>(_v) = zoomUri(); break;
        case 21: *reinterpret_cast< float*>(_v) = zoomXRangeMin(); break;
        case 22: *reinterpret_cast< float*>(_v) = zoomXRangeMax(); break;
        default: break;
        }
        _id -= 23;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setPtzConfigurationToken(*reinterpret_cast< QString*>(_v)); break;
        case 1: setName(*reinterpret_cast< QString*>(_v)); break;
        case 2: setUseCount(*reinterpret_cast< int*>(_v)); break;
        case 3: setNodeToken(*reinterpret_cast< QString*>(_v)); break;
        case 4: setDefaultAbsoluteZoomPositionSpace(*reinterpret_cast< QString*>(_v)); break;
        case 5: setDefaultRelativePanTiltTranslationSpace(*reinterpret_cast< QString*>(_v)); break;
        case 6: setDefaultRelativeZoomTranslationSpace(*reinterpret_cast< QString*>(_v)); break;
        case 7: setDefaultContinuousPanTiltVelocitySpace(*reinterpret_cast< QString*>(_v)); break;
        case 8: setDefaultContinuousZoomVelocitySpace(*reinterpret_cast< QString*>(_v)); break;
        case 9: setPanTiltSpace(*reinterpret_cast< QString*>(_v)); break;
        case 10: setPanTiltX(*reinterpret_cast< float*>(_v)); break;
        case 11: setPanTiltY(*reinterpret_cast< float*>(_v)); break;
        case 12: setZoomSpace(*reinterpret_cast< QString*>(_v)); break;
        case 13: setZoomX(*reinterpret_cast< float*>(_v)); break;
        case 14: setDefaultPTZTimeout(*reinterpret_cast< QString*>(_v)); break;
        case 15: setPanTiltUri(*reinterpret_cast< QString*>(_v)); break;
        case 16: setPanTiltXRangeMin(*reinterpret_cast< float*>(_v)); break;
        case 17: setPanTiltXRangeMax(*reinterpret_cast< float*>(_v)); break;
        case 18: setPanTiltYRangeMin(*reinterpret_cast< float*>(_v)); break;
        case 19: setPanTiltYRangeMax(*reinterpret_cast< float*>(_v)); break;
        case 20: setZoomUri(*reinterpret_cast< QString*>(_v)); break;
        case 21: setZoomXRangeMin(*reinterpret_cast< float*>(_v)); break;
        case 22: setZoomXRangeMax(*reinterpret_cast< float*>(_v)); break;
        default: break;
        }
        _id -= 23;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 23;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 23;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 23;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 23;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 23;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 23;
    } else if (_c == QMetaObject::RegisterPropertyMetaType) {
        if (_id < 23)
            *reinterpret_cast<int*>(_a[0]) = -1;
        _id -= 23;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
void TangibleObjectImplementation::decreaseUseCount() {
	setUseCount(useCount - 1, true);
}
Ejemplo n.º 8
0
int ONVIF::AudioEncoderConfiguration::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 13)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 13;
    } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
        if (_id < 13)
            *reinterpret_cast<int*>(_a[0]) = -1;
        _id -= 13;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< QString*>(_v) = token(); break;
        case 1: *reinterpret_cast< QString*>(_v) = name(); break;
        case 2: *reinterpret_cast< int*>(_v) = useCount(); break;
        case 3: *reinterpret_cast< QString*>(_v) = encoding(); break;
        case 4: *reinterpret_cast< int*>(_v) = bitrate(); break;
        case 5: *reinterpret_cast< int*>(_v) = sampleRate(); break;
        case 6: *reinterpret_cast< QString*>(_v) = type(); break;
        case 7: *reinterpret_cast< QString*>(_v) = ipv4Address(); break;
        case 8: *reinterpret_cast< QString*>(_v) = ipv6Address(); break;
        case 9: *reinterpret_cast< int*>(_v) = port(); break;
        case 10: *reinterpret_cast< int*>(_v) = ttl(); break;
        case 11: *reinterpret_cast< bool*>(_v) = autoStart(); break;
        case 12: *reinterpret_cast< QString*>(_v) = sessionTimeout(); break;
        }
        _id -= 13;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setToken(*reinterpret_cast< QString*>(_v)); break;
        case 1: setName(*reinterpret_cast< QString*>(_v)); break;
        case 2: setUseCount(*reinterpret_cast< int*>(_v)); break;
        case 3: setEncoding(*reinterpret_cast< QString*>(_v)); break;
        case 4: setBitrate(*reinterpret_cast< int*>(_v)); break;
        case 5: setSampleRate(*reinterpret_cast< int*>(_v)); break;
        case 6: setType(*reinterpret_cast< QString*>(_v)); break;
        case 7: setIpv4Address(*reinterpret_cast< QString*>(_v)); break;
        case 8: setIpv6Address(*reinterpret_cast< QString*>(_v)); break;
        case 9: setPort(*reinterpret_cast< int*>(_v)); break;
        case 10: setTtl(*reinterpret_cast< int*>(_v)); break;
        case 11: setAutoStart(*reinterpret_cast< bool*>(_v)); break;
        case 12: setSessionTimeout(*reinterpret_cast< QString*>(_v)); break;
        }
        _id -= 13;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 13;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 13;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 13;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 13;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 13;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 13;
    } else if (_c == QMetaObject::RegisterPropertyMetaType) {
        if (_id < 13)
            *reinterpret_cast<int*>(_a[0]) = -1;
        _id -= 13;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
int ONVIF::VideoEncoderConfiguration::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 19)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 19;
    } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
        if (_id < 19)
            *reinterpret_cast<int*>(_a[0]) = -1;
        _id -= 19;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< QString*>(_v) = token(); break;
        case 1: *reinterpret_cast< QString*>(_v) = name(); break;
        case 2: *reinterpret_cast< int*>(_v) = useCount(); break;
        case 3: *reinterpret_cast< QString*>(_v) = encoding(); break;
        case 4: *reinterpret_cast< int*>(_v) = width(); break;
        case 5: *reinterpret_cast< int*>(_v) = height(); break;
        case 6: *reinterpret_cast< int*>(_v) = quality(); break;
        case 7: *reinterpret_cast< int*>(_v) = frameRateLimit(); break;
        case 8: *reinterpret_cast< int*>(_v) = encodingInterval(); break;
        case 9: *reinterpret_cast< int*>(_v) = bitrateLimit(); break;
        case 10: *reinterpret_cast< int*>(_v) = govLength(); break;
        case 11: *reinterpret_cast< QString*>(_v) = h264Profile(); break;
        case 12: *reinterpret_cast< QString*>(_v) = type(); break;
        case 13: *reinterpret_cast< QString*>(_v) = ipv4Address(); break;
        case 14: *reinterpret_cast< QString*>(_v) = ipv6Address(); break;
        case 15: *reinterpret_cast< int*>(_v) = port(); break;
        case 16: *reinterpret_cast< int*>(_v) = ttl(); break;
        case 17: *reinterpret_cast< bool*>(_v) = autoStart(); break;
        case 18: *reinterpret_cast< QString*>(_v) = sessionTimeout(); break;
        default: break;
        }
        _id -= 19;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setToken(*reinterpret_cast< QString*>(_v)); break;
        case 1: setName(*reinterpret_cast< QString*>(_v)); break;
        case 2: setUseCount(*reinterpret_cast< int*>(_v)); break;
        case 3: setEncoding(*reinterpret_cast< QString*>(_v)); break;
        case 4: setWidth(*reinterpret_cast< int*>(_v)); break;
        case 5: setHeight(*reinterpret_cast< int*>(_v)); break;
        case 6: setQuality(*reinterpret_cast< int*>(_v)); break;
        case 7: setFrameRateLimit(*reinterpret_cast< int*>(_v)); break;
        case 8: setEncodingInterval(*reinterpret_cast< int*>(_v)); break;
        case 9: setBitrateLimit(*reinterpret_cast< int*>(_v)); break;
        case 10: setGovLength(*reinterpret_cast< int*>(_v)); break;
        case 11: setH264Profile(*reinterpret_cast< QString*>(_v)); break;
        case 12: setType(*reinterpret_cast< QString*>(_v)); break;
        case 13: setIpv4Address(*reinterpret_cast< QString*>(_v)); break;
        case 14: setIpv6Address(*reinterpret_cast< QString*>(_v)); break;
        case 15: setPort(*reinterpret_cast< int*>(_v)); break;
        case 16: setTtl(*reinterpret_cast< int*>(_v)); break;
        case 17: setAutoStart(*reinterpret_cast< bool*>(_v)); break;
        case 18: setSessionTimeout(*reinterpret_cast< QString*>(_v)); break;
        default: break;
        }
        _id -= 19;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 19;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 19;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 19;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 19;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 19;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 19;
    } else if (_c == QMetaObject::RegisterPropertyMetaType) {
        if (_id < 19)
            *reinterpret_cast<int*>(_a[0]) = -1;
        _id -= 19;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}