123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- #include "Item.h"
- Item::Item(const ItemType* zType, const char* name)
- : ReferenceCounter(),
- zType(zType),
- zBlockType(0),
- damage(0),
- maxDamage(0),
- durability(0),
- maxDurability(0),
- eatable(0),
- placeable(0),
- equippable(0),
- solid(1),
- usable(0),
- maxStackSize(50),
- name(name)
- {}
- void Item::tick()
- {}
- const ItemType* Item::zItemType() const
- {
- return zType;
- }
- const BlockType* Item::zPlacedBlockType() const
- {
- return zBlockType;
- }
- float Item::getDamage() const
- {
- return damage;
- }
- float Item::getDurability() const
- {
- return durability;
- }
- bool Item::isUsable() const
- {
- return usable;
- }
- bool Item::isEatable() const
- {
- return eatable;
- }
- bool Item::isPlaceable() const
- {
- return placeable;
- }
- bool Item::isEquippable() const
- {
- return equippable;
- }
- bool Item::isSolid() const
- {
- return solid;
- }
- float Item::getMaxDurability() const
- {
- return maxDurability;
- }
- int Item::getMaxStackSize() const
- {
- return maxStackSize;
- }
- float Item::getMaxDamage() const
- {
- return maxDamage;
- }
- bool Item::canBeStackedWith(Item* zItem) const
- {
- return zType == zItem->zType && damage == 0 &&
- zItem->damage == 0 &&
- durability == maxDurability &&
- zItem->durability == zItem->maxDurability &&
- maxDamage == zItem->maxDamage &&
- eatable == zItem->eatable &&
- placeable == zItem->placeable &&
- equippable == zItem->eatable &&
- solid == zItem->solid &&
- usable == zItem->usable &&
- maxStackSize == zItem->maxStackSize &&
- name.istGleich(zItem->name);
- }
- void Item::onPlaced()
- {
- damage = maxDamage;
- durability = 0;
- }
- void Item::applyInventoryEffects(Entity* zTarget)
- {}
- void Item::removeInventoryEffects(Entity* zTarget)
- {}
- void Item::applyEquippedEffects(Entity* zTarget)
- {}
- void Item::removeEquippedEffects(Entity* zTarget)
- {}
- void Item::applyFoodEffects(Entity* zTarget)
- {}
|