当前位置: 首页>>代码示例>>C++>>正文


C++ DroidComponent::changeAttributeValue方法代码示例

本文整理汇总了C++中DroidComponent::changeAttributeValue方法的典型用法代码示例。如果您正苦于以下问题:C++ DroidComponent::changeAttributeValue方法的具体用法?C++ DroidComponent::changeAttributeValue怎么用?C++ DroidComponent::changeAttributeValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DroidComponent的用法示例。


在下文中一共展示了DroidComponent::changeAttributeValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: addToStack

void DroidStimpackModuleDataComponent::addToStack(BaseDroidModuleComponent* other) {
    DroidStimpackModuleDataComponent* otherModule = cast<DroidStimpackModuleDataComponent*>(other);
    if(otherModule == NULL)
        return;
    speed = speed + otherModule->speed;
    capacity = capacity + otherModule->capacity;
    DroidComponent* droidComponent = cast<DroidComponent*>(getParent());
    if (droidComponent != NULL) {
        droidComponent->changeAttributeValue("stimpack_capacity",(float)capacity);
        droidComponent->changeAttributeValue("stimpack_speed",(float)speed);
    }
}
开发者ID:angelsounds777,项目名称:Core3-CU,代码行数:12,代码来源:DroidStimpackModuleDataComponent.cpp

示例2: addToStack

void DroidDetonationModuleDataComponent::addToStack(BaseDroidModuleComponent* other) {
	DroidDetonationModuleDataComponent* otherModule = cast<DroidDetonationModuleDataComponent*>(other);
	if (otherModule == NULL)
		return;

	rating = rating + otherModule->rating;
	moduleCount += 1;

	DroidComponent* droidComponent = cast<DroidComponent*>(getParent());
	if (droidComponent != NULL) {
		droidComponent->changeAttributeValue("bomb_level", (float)rating);
		droidComponent->changeAttributeValue("module_count", (float)moduleCount);
	}
}
开发者ID:JigglyPoofSWG,项目名称:BSS,代码行数:14,代码来源:DroidDetonationModuleDataComponent.cpp

示例3: addToStack

void DroidMaintenanceModuleDataComponent::addToStack(BaseDroidModuleComponent* other){

	DroidMaintenanceModuleDataComponent* otherModule = cast<DroidMaintenanceModuleDataComponent*>(other);
	if( otherModule == NULL )
		return;

	// Maintenance modules do not stack.  Just keep the highest rated module
	if( otherModule->moduleRating > moduleRating )
		moduleRating = otherModule->moduleRating;

	// Save stat in parent sceno
	DroidComponent* droidComponent = cast<DroidComponent*>(getParent());
	if (droidComponent == NULL)
		return;

	// Attribute should have already been created in copy method
	if( !droidComponent->changeAttributeValue( "struct_module", moduleRating) ){
		info( "addToStack updateAttributeValue failed");
		return;
	}

	if (moduleRating < 6) {
		maxStructures = 3;
	} else if (moduleRating < 12) {
		maxStructures = 6;
	} else if (moduleRating < 15) {
		maxStructures = 9;
	} else {
		maxStructures = 10;
	}

}
开发者ID:blacknightownzjoo,项目名称:SWGOOW,代码行数:32,代码来源:DroidMaintenanceModuleDataComponent.cpp

示例4: addToStack

void DroidHarvestModuleDataComponent::addToStack(BaseDroidModuleComponent* other){

	DroidHarvestModuleDataComponent* otherModule = cast<DroidHarvestModuleDataComponent*>(other);
	if( otherModule == NULL )
		return;

	harvestBonus = harvestBonus + otherModule->harvestBonus;

	// Save stat in parent sceno
	DroidComponent* droidComponent = cast<DroidComponent*>(getParent());
	if (droidComponent == NULL)
		return;
	droidComponent->changeAttributeValue( "harvest_power", harvestBonus);

}
开发者ID:duffstone01,项目名称:duffEMU,代码行数:15,代码来源:DroidHarvestModuleDataComponent.cpp

示例5: addToStack

void DroidArmorModuleDataComponent::addToStack(BaseDroidModuleComponent* other) {

	DroidArmorModuleDataComponent* otherModule = cast<DroidArmorModuleDataComponent*>(other);
	if (otherModule == NULL)
		return;

	armorModule = armorModule + otherModule->armorModule;

	// Save stat in parent sceno
	DroidComponent* droidComponent = cast<DroidComponent*>(getParent());
	if (droidComponent == NULL)
		return;

	// Attribute should have already been created in copy method
	if (!droidComponent->changeAttributeValue( "armor_module", armorModule)) {
		info( "addToStack updateAttributeValue failed");
		return;
	}
}
开发者ID:ModTheGalaxy,项目名称:mtgserver,代码行数:19,代码来源:DroidArmorModuleDataComponent.cpp

示例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);
	}
}
开发者ID:JigglyPoofSWG,项目名称:BSS,代码行数:21,代码来源:DroidDetonationModuleDataComponent.cpp


注:本文中的DroidComponent::changeAttributeValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。