ItemModifier.h 696 B

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #include <ReferenceCounter.h>
  3. #include <Text.h>
  4. #include "Item.h"
  5. class ItemModifier : public virtual Framework::ReferenceCounter
  6. {
  7. public:
  8. ItemModifier();
  9. virtual void applyOn(Item* zItem) = 0;
  10. };
  11. class AttributeItemModifier : public ItemModifier
  12. {
  13. private:
  14. Framework::Text attribute;
  15. Framework::Text value;
  16. public:
  17. AttributeItemModifier(Framework::Text attribute, Framework::Text value);
  18. void applyOn(Item* zItem) override;
  19. };
  20. class CombinedItemModifier : public ItemModifier
  21. {
  22. Framework::RCArray<ItemModifier> modifiers;
  23. public:
  24. CombinedItemModifier();
  25. void addModifier(ItemModifier* modifier);
  26. void applyOn(Item* zItem) override;
  27. };