void DroidStimpackModuleDataComponent::copy(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->addProperty("stimpack_speed",(float)speed,0,"exp_effectiveness");
        droidComponent->addProperty("stimpack_capacity",(float)capacity,0,"exp_durability");
    }
}
void DroidDetonationModuleDataComponent::copy(BaseDroidModuleComponent* other) {
	DroidDetonationModuleDataComponent* otherModule = cast<DroidDetonationModuleDataComponent*>(other);
	if (otherModule == NULL)
		return;

	rating = otherModule->rating;
	moduleCount = 1;

	DroidComponent* droidComponent = cast<DroidComponent*>(getParent());
	if (droidComponent != NULL) {
		droidComponent->addProperty("bomb_level", (float)rating, 0, "exp_effectiveness");
		droidComponent->addProperty("module_count", (float)moduleCount, 0, "hidden", true);
		droidComponent->addProperty("module_init", 0, 0, "hidden", true);
	}
}
void DroidMaintenanceModuleDataComponent::copy(BaseDroidModuleComponent* other){

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

	moduleRating = otherModule->moduleRating;

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

	droidComponent->addProperty("struct_module", moduleRating, 0, "exp_effectiveness");

	if (moduleRating < 6) {
		maxStructures = 3;
	} else if (moduleRating < 12) {
		maxStructures = 6;
	} else if (moduleRating < 15) {
		maxStructures = 9;
	} else {
		maxStructures = 10;
	}
}
void DroidDetonationModuleDataComponent::setSpecies(int i) {
	species = i;
	mseDroid = i == DroidObject::MSE;

	DroidComponent* droidComponent = cast<DroidComponent*>(getParent());
	if (droidComponent != NULL) {
		droidComponent->addProperty("species", (float)species, 0, "hidden", true);
	}
}
void DroidHarvestModuleDataComponent::copy(BaseDroidModuleComponent* other){

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

	harvestBonus = otherModule->harvestBonus;

	// Save stat in parent sceno
	DroidComponent* droidComponent = cast<DroidComponent*>(getParent());
	if (droidComponent == NULL)
		return;
	droidComponent->addProperty("harvest_power", harvestBonus, 0, "exp_effectiveness");
}
void DroidArmorModuleDataComponent::copy(BaseDroidModuleComponent* other) {

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

	armorModule = otherModule->armorModule;

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

	droidComponent->addProperty("armor_module", armorModule, 0, "exp_effectiveness");
}
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);
	}
}