ManaPlus
|
#include <item.h>
Public Member Functions | |
Item (const int id, const ItemTypeT type, const int quantity, const uint8_t refine, const ItemColor color, const Identified identified, const Damaged damaged, const Favorite favorite, const Equipm equipment, const Equipped equipped) | |
virtual | ~Item () |
void | setId (const int id, const ItemColor color) |
int | getId () const |
Image * | getImage () const |
void | setQuantity (const int quantity) |
void | increaseQuantity (const int amount) |
int | getQuantity () const |
void | setEquipment (const Equipm equipment) |
Equipm | isEquipment () const |
void | setEquipped (const Equipped equipped) |
Equipped | isEquipped () const |
void | setRefine (const uint8_t refine) |
uint8_t | getRefine () const |
void | setInEquipment (const bool inEquipment) |
bool | isInEquipment () const |
void | setInvIndex (const int index) |
int | getInvIndex () const |
const ItemInfo & | getInfo () const |
std::string | getName () const |
bool | isHaveTag (const int tagId) const |
ItemColor | getColor () const |
void | setColor (const ItemColor color) |
const std::string & | getDescription () const |
void | setIdentified (const Identified b) |
Identified | getIdentified () const |
void | setDamaged (const Damaged b) |
Damaged | getDamaged () const |
void | setFavorite (const Favorite b) |
Favorite | getFavorite () const |
void | setCard (const int index, const int id) |
int | getCard (const int index) const |
void | setCards (const int *const cards, const int size) |
const int * | getCards () const |
void | setOptions (const ItemOptionsList *const options) |
const ItemOptionsList * | getOptions () const |
void | setType (const ItemTypeT type) |
ItemTypeT | getType () const |
void | setTag (const int tag) |
int | getTag () const |
void | addCard (const int card) |
void | updateColor () |
Static Public Member Functions | |
static Image * | getImage (const int id, const ItemColor color) |
static bool | isItem (const int id) |
Data Fields | |
int | mId |
ItemColor | mColor |
int | mQuantity |
int | mTag |
Protected Attributes | |
Image * | mImage |
std::string | mDescription |
std::map< int, int > | mTags |
int | mCards [4] |
const ItemOptionsList * | mOptions |
uint8_t | mRefine |
int | mInvIndex |
ItemTypeT | mType |
Equipm | mEquipment |
Equipped | mEquipped |
bool | mInEquipment |
Identified | mIdentified |
Damaged | mDamaged |
Favorite | mFavorite |
Item::Item | ( | const int | id, |
const ItemTypeT | type, | ||
const int | quantity, | ||
const uint8_t | refine, | ||
const ItemColor | color, | ||
const Identified | identified, | ||
const Damaged | damaged, | ||
const Favorite | favorite, | ||
const Equipm | equipment, | ||
const Equipped | equipped | ||
) |
|
virtual |
void Item::addCard | ( | const int | card | ) |
int Item::getCard | ( | const int | index | ) | const |
Definition at line 159 of file item.cpp.
References maxCards, and mCards.
Referenced by PopupMenu::showDropPopup(), PopupMenu::showItemPopup(), PopupMenu::showPopup(), and PopupMenu::showUndressPopup().
|
inline |
Definition at line 214 of file item.h.
References mCards.
Referenced by EAthena::TradeRecv::processTradeItemAddResponse(), TmwAthena::TradeRecv::processTradeItemAddResponse(), and ItemPopup::setItem().
|
inline |
Definition at line 181 of file item.h.
References mColor.
Referenced by BuyDialog::action(), NpcDialog::action(), ShopWindow::action(), ShopWindow::addBuyItem(), ComplexItem::addChild(), MailEditWindow::addItem(), SellDialog::addItem(), ShopWindow::addSellItem(), ComplexInventory::addVirtualItem(), Inventory::addVirtualItem(), TradeWindow::checkItem(), OutfitWindow::copyFromEquiped(), DragDrop::dragItem(), ShopItems::findItem(), TradeWindow::initTrade(), ItemContainer::mouseReleased(), anonymous_namespace{itemcontainer.cpp}::SortItemAlphaFunctor::operator()(), EAthena::TradeRecv::processTradeItemAddResponse(), TmwAthena::TradeRecv::processTradeItemAddResponse(), DragDrop::select(), BuyingStoreSellDialog::sellAction(), ItemPopup::setItem(), ItemShortcut::setItemSelected(), ShortcutBase::setItemSelected(), PopupMenu::showDropPopup(), PopupMenu::showItemPopup(), PopupMenu::showPopup(), and PopupMenu::showUndressPopup().
|
inline |
Definition at line 199 of file item.h.
References mDamaged.
Referenced by ComplexItem::addChild(), MailEditWindow::addItem(), ComplexInventory::addVirtualItem(), Inventory::addVirtualItem(), ItemContainer::mouseReleased(), EAthena::TradeRecv::processTradeItemAddResponse(), and TmwAthena::TradeRecv::processTradeItemAddResponse().
|
inline |
|
inline |
Definition at line 205 of file item.h.
References mFavorite.
Referenced by ComplexItem::addChild(), MailEditWindow::addItem(), ComplexInventory::addVirtualItem(), Inventory::addVirtualItem(), ItemContainer::mouseReleased(), EAthena::TradeRecv::processTradeItemAddResponse(), and TmwAthena::TradeRecv::processTradeItemAddResponse().
|
inline |
Returns the item id.
Definition at line 81 of file item.h.
References mId.
Referenced by BuyDialog::action(), InventoryWindow::action(), NpcDialog::action(), ShopWindow::action(), TradeWindow::action(), ShopWindow::addBuyItem(), ComplexItem::addChild(), MailEditWindow::addItem(), SellDialog::addItem(), ShopWindow::addSellItem(), ComplexInventory::addVirtualItem(), Inventory::addVirtualItem(), ShopWindow::announce(), EAthena::CashShopHandler::buyItems(), EAthena::BarterHandler::buyItems(), EAthena::MarketHandler::buyItems(), EAthena::NpcHandler::buyItems(), TradeWindow::checkItem(), OutfitWindow::copyFromEquiped(), EAthena::BuyingStoreHandler::create(), DragDrop::dragItem(), ItemContainer::draw(), ShopListBox::draw(), PlayerInfo::dropItem(), EAthena::PetHandler::evolution(), ShopItems::findItem(), ShopWindow::findShopItem(), ShopWindow::giveList(), TradeWindow::initTrade(), InventoryWindow::mouseClicked(), ItemContainer::mousePressed(), ItemContainer::mouseReleased(), ItemSoundManager::playSfx(), EAthena::InventoryRecv::processPlayerCartAdd(), EAthena::InventoryRecv::processPlayerInsertCard(), EAthena::InventoryRecv::processPlayerInventoryAdd(), TmwAthena::InventoryRecv::processPlayerInventoryAdd(), ShopWindow::processRequest(), EAthena::TradeRecv::processTradeItemAddResponse(), TmwAthena::TradeRecv::processTradeItemAddResponse(), EAthena::RefineHandler::refineItem(), ItemContainer::safeDraw(), ShopWindow::saveList(), DragDrop::select(), EAthena::BuyingStoreHandler::sell(), BuyingStoreSellDialog::sellAction(), NpcSellDialog::sellAction(), ShopSellDialog::sellAction(), TmwAthena::BuySellHandler::sendBuyRequest(), MailEditWindow::sendMail(), TmwAthena::BuySellHandler::sendSellRequest(), ItemPopup::setItem(), ItemShortcut::setItemSelected(), ShortcutBase::setItemSelected(), PopupMenu::showDropPopup(), PopupMenu::showItemPopup(), PopupMenu::showPopup(), PopupMenu::showUndressPopup(), ShopWindow::sumAmount(), OutfitWindow::unequipNotInOutfit(), ItemContainer::updateMatrix(), PlayerInfo::useEquipItem(), PlayerInfo::useEquipItem2(), EAthena::InventoryHandler::useItem(), and TmwAthena::InventoryHandler::useItem().
|
inline |
Definition at line 193 of file item.h.
References mIdentified.
Referenced by ComplexItem::addChild(), MailEditWindow::addItem(), ComplexInventory::addVirtualItem(), Inventory::addVirtualItem(), ItemContainer::mouseReleased(), EAthena::TradeRecv::processTradeItemAddResponse(), and TmwAthena::TradeRecv::processTradeItemAddResponse().
|
inline |
Returns the item image.
Definition at line 87 of file item.h.
References mImage.
Referenced by ItemAmountWindow::action(), DragDrop::dragItem(), ItemContainer::draw(), ItemShortcutContainer::draw(), ShopListBox::draw(), VirtShortcutContainer::draw(), EquipmentWindow::draw(), OutfitWindow::draw(), ItemContainer::safeDraw(), ItemShortcutContainer::safeDraw(), VirtShortcutContainer::safeDraw(), EquipmentWindow::safeDraw(), and OutfitWindow::safeDraw().
Definition at line 127 of file item.cpp.
References combineDye2(), ItemDB::get(), Loader::getImage(), Theme::getImageFromTheme(), Configuration::getStringValue(), Actions::info(), pathJoin(), and paths.
|
inline |
Returns information about this item type.
Definition at line 171 of file item.h.
References ItemDB::get(), and mId.
Referenced by PopupMenu::addItemMenu(), PopupMenu::addUse(), ShopWindow::announce(), Inventory::findItemBySprite(), LocalPlayer::getAttackRange(), ItemContainer::mousePressed(), anonymous_namespace{itemcontainer.cpp}::SortItemAlphaFunctor::operator()(), EAthena::VendingRecv::processReport(), ShopWindow::processRequest(), setId(), ItemPopup::setItem(), InventoryWindow::updateButtons(), ShopItem::updateDisplayName(), and ItemContainer::updateMatrix().
|
inline |
Returns the inventory index of this item.
Definition at line 165 of file item.h.
References mInvIndex.
Referenced by InventoryWindow::action(), ShopWindow::action(), ComplexItem::addChild(), EAthena::RefineHandler::addItem(), EAthena::Mail2Handler::addItem(), EAthena::TradeHandler::addItem(), TmwAthena::TradeHandler::addItem(), SellDialog::addItem(), ComplexInventory::addVirtualItem(), Inventory::addVirtualItem(), EAthena::VendingHandler::buyItems(), InventoryWindow::combineItems(), NpcDialog::complexItemToStr(), EAthena::VendingHandler::createShop(), EAthena::InventoryHandler::dropItem(), TmwAthena::InventoryHandler::dropItem(), EAthena::InventoryHandler::equipItem(), TmwAthena::InventoryHandler::equipItem(), EAthena::InventoryHandler::favoriteItem(), ItemAmountWindow::finish(), EAthena::InventoryHandler::identifyItem(), InventoryWindow::mouseClicked(), ItemContainer::mouseReleased(), anonymous_namespace{itemcontainer.cpp}::SortItemAlphaFunctor::operator()(), EAthena::RefineHandler::refineItem(), EAthena::InventoryHandler::selectEgg(), EAthena::BuyingStoreHandler::sell(), InsertCardDialog::sellAction(), MailEditWindow::sendMail(), EAthena::AuctionHandler::setItem(), PopupMenu::showDropPopup(), PopupMenu::showItemPopup(), PopupMenu::showPopup(), PopupMenu::showUndressPopup(), EAthena::InventoryHandler::unequipItem(), TmwAthena::InventoryHandler::unequipItem(), EAthena::InventoryHandler::useCard(), EAthena::InventoryHandler::useItem(), TmwAthena::InventoryHandler::useItem(), and Inventory::virtualRemove().
std::string Item::getName | ( | ) | const |
Definition at line 140 of file item.cpp.
References ItemDB::get(), Net::getNetworkType(), Actions::info(), mColor, mId, and ServerType::TMWATHENA.
Referenced by BuyDialog::applyNameFilter(), InventoryWindow::combineItems(), InsertCardDialog::InsertCardDialog(), EAthena::InventoryRecv::processBindItem(), EAthena::InventoryRecv::processPlayerRefine(), EAthena::Mail2Recv::processRemoveItemResult(), PopupMenu::showDropPopup(), PopupMenu::showItemPopup(), PopupMenu::showPopup(), and ShopItem::updateDisplayName().
|
inline |
Definition at line 219 of file item.h.
References mOptions.
Referenced by EAthena::TradeRecv::processTradeItemAddResponse(), and ItemPopup::setItem().
|
inline |
Returns the number of items.
Definition at line 105 of file item.h.
References mQuantity.
Referenced by InventoryWindow::action(), ItemAmountWindow::action(), ShopWindow::action(), PopupMenu::addDrop(), SellDialog::addItem(), PopupMenu::addItemMenu(), ComplexInventory::addVirtualItem(), ShopWindow::announce(), TradeWindow::checkItem(), NpcDialog::complexItemToStr(), EAthena::BuyingStoreHandler::create(), EAthena::VendingHandler::createShop(), ItemContainer::draw(), ItemShortcutContainer::draw(), VirtShortcutContainer::draw(), EquipmentWindow::draw(), DropShortcut::dropFirst(), DropShortcut::dropItem(), ItemShortcut::equipItem(), ShopWindow::findShopItem(), Actions::getAmountFromEvent(), ShopWindow::giveList(), TradeWindow::initTrade(), ItemAmountWindow::ItemAmountWindow(), InventoryWindow::mouseClicked(), ItemContainer::mouseReleased(), InventoryWindow::moveItemToCraft(), EAthena::InventoryRecv::processPlayerCartAdd(), EAthena::InventoryRecv::processPlayerInsertCard(), EAthena::InventoryRecv::processPlayerInventoryAdd(), TmwAthena::InventoryRecv::processPlayerInventoryAdd(), ShopWindow::processRequest(), ItemContainer::safeDraw(), ItemShortcutContainer::safeDraw(), VirtShortcutContainer::safeDraw(), EquipmentWindow::safeDraw(), ShopWindow::saveList(), TmwAthena::BuySellHandler::sendBuyRequest(), MailEditWindow::sendMail(), TmwAthena::BuySellHandler::sendSellRequest(), ShopWindow::showList(), PopupMenu::showPopup(), ItemAmountWindow::showWindow(), ShopWindow::startTrade(), ShopWindow::sumAmount(), ItemShortcut::unequipItem(), StatusWindow::updateArrowsBar(), InventoryWindow::updateButtons(), SellDialog::updateButtonsAndLabels(), BuyDialog::updateButtonsAndLabels(), InventoryWindow::updateDropButton(), ItemContainer::updateMatrix(), ItemShortcut::useItem(), InventoryWindow::valueChanged(), and OutfitWindow::wearOutfit().
|
inline |
Returns this item refine level.
Definition at line 141 of file item.h.
References mRefine.
Referenced by ComplexItem::addChild(), MailEditWindow::addItem(), ComplexInventory::addVirtualItem(), EAthena::TradeRecv::processTradeItemAddResponse(), TmwAthena::TradeRecv::processTradeItemAddResponse(), and ItemPopup::setItem().
|
inline |
Definition at line 231 of file item.h.
References mTag.
Referenced by NpcDialog::action(), ComplexItem::addChild(), ComplexInventory::addVirtualItem(), ItemContainer::mouseReleased(), and Inventory::virtualRestore().
|
inline |
Definition at line 225 of file item.h.
References mType.
Referenced by BuyDialog::action(), ShopWindow::addBuyItem(), ComplexItem::addChild(), MailEditWindow::addItem(), SellDialog::addItem(), ShopWindow::addSellItem(), ComplexInventory::addVirtualItem(), Inventory::addVirtualItem(), EAthena::CashShopHandler::buyItems(), EAthena::BarterHandler::buyItems(), EAthena::MarketHandler::buyItems(), EAthena::NpcHandler::buyItems(), InventoryWindow::combineItems(), ItemContainer::mouseReleased(), EAthena::TradeRecv::processTradeItemAddResponse(), TmwAthena::TradeRecv::processTradeItemAddResponse(), setId(), and PlayerInfo::useEquipItem().
|
inline |
Increases the number of items by the given amount.
Definition at line 99 of file item.h.
References mQuantity.
Referenced by BuyDialog::action(), ComplexItem::addChild(), EAthena::VendingHandler::buyItems(), EAthena::CashShopHandler::buyItems(), EAthena::BarterHandler::buyItems(), EAthena::MarketHandler::buyItems(), TradeWindow::increaseQuantity(), EAthena::Mail2Recv::processAddItemResult(), EAthena::InventoryRecv::processPlayerInsertCard(), EAthena::Mail2Recv::processRemoveItemResult(), EAthena::TradeRecv::processTradeItemAddResponse(), and TmwAthena::TradeRecv::processTradeItemAddResponse().
|
inline |
Returns whether this item is considered equipment.
Definition at line 117 of file item.h.
References mEquipment.
Referenced by EquipmentWindow::action(), PopupMenu::addItemMenu(), PopupMenu::addUse(), ItemShortcut::equipItem(), EquipmentWindow::mouseReleased(), EAthena::TradeRecv::processTradeItemAddResponse(), TmwAthena::TradeRecv::processTradeItemAddResponse(), ItemShortcut::unequipItem(), InventoryWindow::updateButtons(), PlayerInfo::useEquipItem(), PlayerInfo::useEquipItem2(), and OutfitWindow::wearOutfit().
|
inline |
Returns whether this item is equipped.
Definition at line 129 of file item.h.
References mEquipped.
Referenced by EquipmentWindow::action(), PopupMenu::addItemMenu(), PopupMenu::addUse(), LocalPlayer::changeEquipmentBeforeAttack(), TradeWindow::checkItem(), OutfitWindow::copyFromEquiped(), ItemContainer::draw(), ItemShortcutContainer::draw(), VirtShortcutContainer::draw(), ItemShortcut::equipItem(), LocalPlayer::imitateOutfit(), ItemContainer::mouseReleased(), EquipmentWindow::mouseReleased(), Ea::BuySellRecv::processNpcSell(), ItemContainer::safeDraw(), ItemShortcutContainer::safeDraw(), VirtShortcutContainer::safeDraw(), ItemShortcut::unequipItem(), OutfitWindow::unequipNotInOutfit(), InventoryWindow::updateButtons(), PlayerInfo::useEquipItem(), PlayerInfo::useEquipItem2(), and OutfitWindow::wearOutfit().
bool Item::isHaveTag | ( | const int | tagId | ) | const |
|
inline |
Returns whether this item is in equipment.
Definition at line 153 of file item.h.
References mInEquipment.
|
inlinestatic |
Definition at line 238 of file item.h.
References CARD0_CREATE, CARD0_FORGE, and CARD0_PET.
Referenced by Being::addItemParticlesCards().
void Item::setCard | ( | const int | index, |
const int | id | ||
) |
void Item::setCards | ( | const int *const | cards, |
const int | size | ||
) |
Definition at line 166 of file item.cpp.
References maxCards, mCards, and EmoteDB::size().
Referenced by BeingEquipBackend::BeingEquipBackend(), and Inventory::setCards().
|
inline |
|
inline |
|
inline |
Sets whether this item is considered equipment.
Definition at line 111 of file item.h.
References mEquipment.
Referenced by Inventory::setItem().
|
inline |
Sets whether this item is equipped.
Definition at line 123 of file item.h.
References mEquipped.
Referenced by Ea::EquipBackend::clear(), and Ea::EquipBackend::setEquipment().
|
inline |
void Item::setId | ( | const int | id, |
const ItemColor | color | ||
) |
Sets the item id, color the item type.
Definition at line 91 of file item.cpp.
References CAST_S32, combineDye2(), fromBool, Loader::getImage(), Theme::getImageFromTheme(), getInfo(), Configuration::getStringValue(), getType(), ConfigurationObject::getValue(), Actions::info(), mColor, mEquipment, mId, mImage, mTags, pathJoin(), and paths.
Referenced by Item(), Inventory::setItem(), and updateColor().
|
inline |
|
inline |
Sets whether this item is in equipment.
Definition at line 147 of file item.h.
References mInEquipment.
|
inline |
Sets the inventory index of this item.
Definition at line 159 of file item.h.
References mInvIndex.
Referenced by ShopWindow::action(), ComplexItem::addChild(), Inventory::moveItem(), EAthena::VendingRecv::processItemsList(), ComplexInventory::setItem(), Inventory::setItem(), and ShopItem::ShopItem().
void Item::setOptions | ( | const ItemOptionsList *const | options | ) |
Definition at line 189 of file item.cpp.
References ItemOptionsList::copy(), delete2, and mOptions.
Referenced by EAthena::VendingRecv::processItemsList(), and Inventory::setOptions().
|
inline |
Sets the number of items.
Definition at line 93 of file item.h.
References mQuantity.
Referenced by ShopWindow::action(), TradeWindow::changeQuantity(), and Inventory::setItem().
|
inline |
Sets this item refine level.
Definition at line 135 of file item.h.
References mRefine.
Referenced by Inventory::setItem().
|
inline |
Definition at line 228 of file item.h.
References mTag.
Referenced by ComplexItem::addChild(), ComplexInventory::addVirtualItem(), Inventory::addVirtualItem(), ItemContainer::mouseReleased(), and Inventory::setTag().
|
inline |
void Item::updateColor | ( | ) |
Definition at line 195 of file item.cpp.
References ItemColorManager::getColorFromCards(), Net::getNetworkType(), mCards, mId, setId(), and ServerType::TMWATHENA.
Referenced by EAthena::InventoryRecv::processPlayerInsertCard().
|
protected |
Definition at line 255 of file item.h.
Referenced by addCard(), getCard(), getCards(), Item(), setCard(), setCards(), and updateColor().
ItemColor Item::mColor |
Definition at line 247 of file item.h.
Referenced by Inventory::findItem(), getColor(), getName(), setColor(), setId(), and ShopItem::updateDisplayName().
|
protected |
Definition at line 264 of file item.h.
Referenced by getDamaged(), and setDamaged().
|
protected |
Definition at line 253 of file item.h.
Referenced by getDescription().
|
protected |
Item is equipment.
Definition at line 260 of file item.h.
Referenced by isEquipment(), setEquipment(), and setId().
|
protected |
Item is equipped.
Definition at line 261 of file item.h.
Referenced by isEquipped(), and setEquipped().
|
protected |
Definition at line 265 of file item.h.
Referenced by getFavorite(), and setFavorite().
int Item::mId |
Item id.
Definition at line 246 of file item.h.
Referenced by Inventory::contains(), Inventory::findItem(), getId(), getInfo(), getName(), Inventory::removeItem(), setId(), and updateColor().
|
protected |
Definition at line 263 of file item.h.
Referenced by getIdentified(), and setIdentified().
|
protected |
|
protected |
Item is in equipment
Definition at line 262 of file item.h.
Referenced by isInEquipment(), and setInEquipment().
|
protected |
Inventory index.
Definition at line 258 of file item.h.
Referenced by ShopItem::getCurrentInvIndex(), getInvIndex(), and setInvIndex().
|
protected |
Definition at line 256 of file item.h.
Referenced by getOptions(), setOptions(), and ~Item().
int Item::mQuantity |
Number of items.
Definition at line 248 of file item.h.
Referenced by ShopItem::addDuplicate(), getQuantity(), increaseQuantity(), ShopItem::increaseUsedQuantity(), Inventory::restoreVirtuals(), ShopItem::sellCurrentDuplicate(), setQuantity(), ShopItem::update(), Inventory::virtualRemove(), and Inventory::virtualRestore().
|
protected |
Item refine level.
Definition at line 257 of file item.h.
Referenced by getRefine(), and setRefine().
int Item::mTag |
Definition at line 249 of file item.h.
Referenced by Inventory::findIndexByTag(), Inventory::findItemByTag(), getTag(), and setTag().
|
protected |
Definition at line 254 of file item.h.
Referenced by isHaveTag(), and setId().
|
protected |