12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #pragma once
- #include <ReferenceCounter.h>
- #include <functional>
- class Item;
- class ItemType;
- class ItemSlot;
- class ItemFilter : public virtual Framework::ReferenceCounter
- {
- public:
- ItemFilter();
- virtual bool matchItem(const Item* zItem) const;
- virtual bool matchSourceSlot(ItemSlot* zSlot) const;
- virtual bool matchTargetSlot(ItemSlot* zSlot) const;
- };
- class CombinedItemFilter : public ItemFilter
- {
- private:
- ItemFilter* filterA;
- ItemFilter* filterB;
- std::function<bool(bool, bool)> op;
- public:
- CombinedItemFilter(ItemFilter* filterA, ItemFilter* filterB, std::function<bool(bool, bool)> op);
- bool matchItem(const Item* zItem) const override;
- };
- class AnyItemFilter : public ItemFilter
- {
- public:
- AnyItemFilter();
- bool matchItem(const Item* zItem) const override;
- };
- class TypeItemFilter : public ItemFilter
- {
- private:
- const ItemType* zType;
- public:
- TypeItemFilter(const ItemType* zType);
- bool matchItem(const Item* zItem) const override;
- };
- class SpecificSlotFilter : public ItemFilter
- {
- private:
- int sourceSlotId;
- int targetSlotId;
- public:
- SpecificSlotFilter(int sourceSlotId, int targetSlotId);
- bool matchSourceSlot(ItemSlot* zSlot) const override;
- bool matchTargetSlot(ItemSlot* zSlot) const override;
- };
|