本文整理汇总了C++中DroidComponent::hasKey方法的典型用法代码示例。如果您正苦于以下问题:C++ DroidComponent::hasKey方法的具体用法?C++ DroidComponent::hasKey怎么用?C++ DroidComponent::hasKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DroidComponent
的用法示例。
在下文中一共展示了DroidComponent::hasKey方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initializeTransientMembers
void DroidDetonationModuleDataComponent::initializeTransientMembers() {
// Pull module stat from parent sceno
DroidComponent* droidComponent = cast<DroidComponent*>(getParent());
if (droidComponent == NULL) {
info("droidComponent was null");
return;
}
/*for (int i = 0; i < droidComponent->getPropertyCount(); i++) {
String prop = droidComponent->getProperty(i);
}*/
if (droidComponent->hasKey("bomb_level")) {
rating = droidComponent->getAttributeValue("bomb_level");
}
if (droidComponent->hasKey("module_count")) {
moduleCount = droidComponent->getAttributeValue("module_count");
}
if (droidComponent->hasKey("module_init")) {
initialized = droidComponent->getAttributeValue("module_init") == 1;
}
if (droidComponent->hasKey("species")) {
species = droidComponent->getAttributeValue("species");
}
if (species == DroidObject::MSE) {
mseDroid = true;
}
}
示例2: initializeTransientMembers
void DroidStimpackModuleDataComponent::initializeTransientMembers() {
DroidComponent* droidComponent = cast<DroidComponent*>(getParent());
if (droidComponent == NULL) {
info("droidComponent was null");
return;
}
if(droidComponent->hasKey( "stimpack_capacity")) {
capacity = droidComponent->getAttributeValue( "stimpack_capacity");
}
if (droidComponent->hasKey("stimpack_speed")) {
speed = droidComponent->getAttributeValue("stimpack_speed");
}
}
示例3: initializeTransientMembers
void DroidMaintenanceModuleDataComponent::initializeTransientMembers() {
// Pull module stat from parent sceno
DroidComponent* droidComponent = cast<DroidComponent*>(getParent());
if (droidComponent == NULL) {
info("droidComponent was null");
return;
}
if( droidComponent->hasKey( "struct_module") ){
moduleRating = droidComponent->getAttributeValue( "struct_module");
}
}
示例4: initializeTransientMembers
void DroidArmorModuleDataComponent::initializeTransientMembers() {
// Pull module stat from parent sceno
DroidComponent* droidComponent = cast<DroidComponent*>(getParent());
if (droidComponent == NULL) {
info("droidComponent was null");
return;
}
if (droidComponent->hasKey("armor_module")) {
armorModule = droidComponent->getAttributeValue("armor_module");
}
}
示例5: initializeTransientMembers
void DroidHarvestModuleDataComponent::initializeTransientMembers() {
// Pull module stat from parent sceno
DroidComponent* droidComponent = cast<DroidComponent*>(getParent());
if (droidComponent == NULL) {
info("droidComponent was null");
return;
}
if( droidComponent->hasKey( "harvest_power") ){
harvestBonus = droidComponent->getAttributeValue( "harvest_power");
}
else{
info( "harvest_power attribute not found" );
}
harvestTargets.removeAll(0,10);
}
示例6: initialize
void DroidDetonationModuleDataComponent::initialize(DroidObject* droid) {
if (droid->getSpecies() == DroidObject::MSE) {
mseDroid = true;
}
// ensure state on init
started = false;
initialized = false;
DroidComponent* droidComponent = cast<DroidComponent*>(getParent());
if (droidComponent == NULL) {
info("droidComponent was null");
return;
}
if (droidComponent->hasKey("module_init")) {
droidComponent->changeAttributeValue("module_init", (float)0);
} else {
droidComponent->addProperty("module_init", 0, 0, "hidden", true);
}
}