#include "DropConfig.h" DropConfig::DropConfig() : ReferenceCounter(), condition(0) {} DropConfig::~DropConfig() { delete condition; } void DropConfig::setCondition(DropCondition* condition) { if (this->condition) { delete this->condition; } this->condition = condition; } void DropConfig::initialize() {} const DropCondition* DropConfig::zCondition() const { return condition; } void DropConfig::onObjectDestroyed(Entity* zActor, Item* zItem, ItemSkill* zUsedSkill, Framework::Either zDestroyedObject) const { if (condition->evaluate(zActor, zItem, zUsedSkill, zDestroyedObject)) { doDrop(zActor, zItem, zUsedSkill, zDestroyedObject); } }