1234567891011121314151617181920212223242526272829303132333435363738 |
- #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<Block*, Entity*> zDestroyedObject) const
- {
- if (condition->evaluate(zActor, zItem, zUsedSkill, zDestroyedObject))
- {
- doDrop(zActor, zItem, zUsedSkill, zDestroyedObject);
- }
- }
|