ManaPlus
|
Typedefs | |
typedef std::map< int, ItemInfo * > | ItemInfos |
typedef std::map< std::string, ItemInfo * > | NamedItemInfos |
Functions | |
void | load () |
void | unload () |
void | loadXmlFile (const std::string &fileName, int &tagNum, const SkipError skipError) |
const StringVect & | getTags () |
bool | exists (const int id) |
bool | exists (const std::string &name) |
const ItemInfo & | get (const int id) |
const ItemInfo & | get (const std::string &name) |
const ItemInfo & | getEmpty () |
int | getNumOfHairstyles () |
const ItemDB::ItemInfos & | getItemInfos () |
std::string | getNamesStr (const std::vector< int > &parts) |
int | getTagId (const std::string &tagName) |
Item information database.
typedef std::map<int, ItemInfo*> ItemDB::ItemInfos |
typedef std::map<std::string, ItemInfo*> ItemDB::NamedItemInfos |
bool ItemDB::exists | ( | const int | id | ) |
Definition at line 773 of file itemdb.cpp.
References anonymous_namespace{itemdb.cpp}::mItemInfos, and anonymous_namespace{itemdb.cpp}::mLoaded.
Referenced by load(), TextCommand::loadImage(), and Being::setSubtype().
bool ItemDB::exists | ( | const std::string & | name | ) |
Definition at line 782 of file itemdb.cpp.
References anonymous_namespace{itemdb.cpp}::mLoaded, anonymous_namespace{itemdb.cpp}::mNamedItemInfos, and normalize().
const ItemInfo & ItemDB::get | ( | const int | id | ) |
Definition at line 792 of file itemdb.cpp.
References AvatarDB::load(), anonymous_namespace{itemdb.cpp}::mItemInfos, anonymous_namespace{itemdb.cpp}::mLoaded, anonymous_namespace{itemdb.cpp}::mUnknown, and reportAlways.
Referenced by ItemAmountWindow::action(), Being::addItemParticlesCards(), ActorManager::cloneBeing(), ItemPopup::getCardsString(), ItemColorManager::getColorFromCards(), Item::getImage(), FloorItem::getInfo(), Item::getInfo(), FloorItem::getName(), Item::getName(), ItemSoundManager::getSoundEffect(), ItemInfo::getSprite(), Being::handleAttack(), ItemLinkHandler::handleItemLink(), load(), TextCommand::loadImage(), ItemSoundManager::playSfx(), FloorItem::postInit(), EAthena::BeingRecv::processBeingChangeLookContinue(), TmwAthena::BeingRecv::processBeingMove(), TmwAthena::BeingRecv::processBeingVisible(), EAthena::HomunculusRecv::processHomunculusFood(), EAthena::InventoryRecv::processPlayerInventoryAdd(), TmwAthena::InventoryRecv::processPlayerInventoryAdd(), EAthena::InventoryRecv::processPlayerItemRentalExpired(), EAthena::InventoryRecv::processPlayerItemRentalTime(), TmwAthena::BeingRecv::processPlayerMove(), TmwAthena::BeingRecv::processPlayerUpdate1(), TmwAthena::BeingRecv::processPlayerUpdate2(), EAthena::SkillRecv::processSkillFailed(), EAthena::CharServerRecv::readPlayerData(), TmwAthena::CharServerRecv::readPlayerData(), Being::recalcSpritesOrder(), replaceItemLinks(), BrowserBoxTools::replaceLinkCommands(), NpcSellDialog::sellAction(), EAthena::setBasicFields(), Being::setGender(), Being::setHairColor(), Being::setHairStyle(), Being::setHairTempSprite(), Being::setSpriteCards(), Being::setSpriteColor(), Being::setSpriteColorId(), Being::setSpriteId(), Being::setSubtype(), Being::setTempSprite(), Being::setWeaponId(), CharCreateDialog::updateHair(), and CharCreateDialog::updateLook().
const ItemInfo & ItemDB::get | ( | const std::string & | name | ) |
Definition at line 808 of file itemdb.cpp.
References AvatarDB::load(), anonymous_namespace{itemdb.cpp}::mLoaded, anonymous_namespace{itemdb.cpp}::mNamedItemInfos, anonymous_namespace{itemdb.cpp}::mUnknown, normalize(), and reportAlways.
const ItemInfo & ItemDB::getEmpty | ( | ) |
Definition at line 834 of file itemdb.cpp.
References anonymous_namespace{itemdb.cpp}::mUnknown.
Referenced by EAthena::InventoryRecv::processPlayerInventoryAdd(), and TmwAthena::InventoryRecv::processPlayerInventoryAdd().
const ItemDB::ItemInfos & ItemDB::getItemInfos | ( | ) |
Definition at line 829 of file itemdb.cpp.
References anonymous_namespace{itemdb.cpp}::mItemInfos.
Referenced by IconsModel::IconsModel(), and ItemsModal::ItemsModal().
std::string ItemDB::getNamesStr | ( | const std::vector< int > & | parts | ) |
Definition at line 1176 of file itemdb.cpp.
References VirtFs::exists(), FOR_EACH, AttributesEnum::get(), and GroupDb::getName().
Referenced by OutfitWindow::getOutfitString().
int ItemDB::getNumOfHairstyles | ( | ) |
Definition at line 1192 of file itemdb.cpp.
References anonymous_namespace{itemdb.cpp}::mNumberOfHairstyles.
Referenced by CharCreateDialog::CharCreateDialog(), and CharCreateDialog::updateHair().
int ItemDB::getTagId | ( | const std::string & | tagName | ) |
Definition at line 754 of file itemdb.cpp.
References anonymous_namespace{itemdb.cpp}::mTags.
Referenced by InventoryWindow::action().
const StringVect & ItemDB::getTags | ( | ) |
Definition at line 749 of file itemdb.cpp.
References anonymous_namespace{itemdb.cpp}::mTagNames.
Referenced by InventoryWindow::InventoryWindow().
void ItemDB::load | ( | ) |
Definition at line 147 of file itemdb.cpp.
References _, ItemInfo::addTag(), BeingTypeId_zero, exists(), Gender::FEMALE, FOR_EACH, get(), VirtFs::getFilesInDir(), EmoteDB::getSprite(), Configuration::getStringValue(), initStatic(), loadXmlFile(), Logger::log1(), logger, Gender::MALE, anonymous_namespace{itemdb.cpp}::mConstructed, anonymous_namespace{itemdb.cpp}::mLoaded, anonymous_namespace{itemdb.cpp}::mNumberOfHairstyles, anonymous_namespace{itemdb.cpp}::mTagNames, anonymous_namespace{itemdb.cpp}::mTags, anonymous_namespace{itemdb.cpp}::mUnknown, paths, ItemInfo::setDisplay(), ItemInfo::setName(), ItemInfo::setSprite(), SkipError_false, SkipError_true, and Net::unload().
Referenced by DbManager::loadDb().
void ItemDB::loadXmlFile | ( | const std::string & | fileName, |
int & | tagNum, | ||
const SkipError | skipError | ||
) |
Definition at line 262 of file itemdb.cpp.
References _, ItemDbType::CARD, CHECK_PARAM, MissileInfo::dieDistance, empty, ItemDbType::EQUIPMENT_AMMO, ItemDbType::EQUIPMENT_ARMS, ItemDbType::EQUIPMENT_CHARM, ItemDbType::EQUIPMENT_FEET, ItemDbType::EQUIPMENT_HEAD, ItemDbType::EQUIPMENT_LEGS, ItemDbType::EQUIPMENT_NECKLACE, ItemDbType::EQUIPMENT_ONE_HAND_WEAPON, ItemDbType::EQUIPMENT_RING, ItemDbType::EQUIPMENT_SHIELD, ItemDbType::EQUIPMENT_TORSO, ItemDbType::EQUIPMENT_TWO_HANDS_WEAPON, fileName, SpriteDisplay::floor, for_each_xml_child_node, fromInt, ItemFieldDb::getAddFields(), ItemInfo::getAttackAction(), ItemInfo::getAttackRange(), XML::getBoolProperty(), ItemInfo::getCardColor(), ItemInfo::getColorsListName(), ItemInfo::getCriticalHitEffectId(), ItemInfo::getDescription(), ItemInfo::getEffect(), XML::getFloatProperty(), ItemInfo::getHitEffectId(), ItemInfo::getIconColorsListName(), XML::getIntProperty(), Configuration::getIntValue(), getIsEquipment(), ItemInfo::getMissEffectId(), ItemInfo::getMissileConst(), ItemInfo::getName(), XML::getProperty(), ItemFieldDb::getRequiredFields(), ItemInfo::getRideAttackAction(), ItemInfo::getSkyAttackAction(), ItemInfo::getType(), ItemInfo::getUseButton(), ItemInfo::getView(), ItemInfo::getWaterAttackAction(), ItemInfo::getWeight(), SpriteDisplay::image, Actions::itemInfo(), itemTypeFromString(), XML::langProperty(), MissileInfo::lifeTime, loadFloorSprite(), loadMenu(), loadOrderSprite(), loadReplaceSprite(), loadSoundRef(), loadSpriteRef(), loadXmlFile(), Logger::log(), logger, mapTileSize, anonymous_namespace{itemdb.cpp}::mItemInfos, anonymous_namespace{itemdb.cpp}::mLoaded, anonymous_namespace{itemdb.cpp}::mNamedItemInfos, anonymous_namespace{itemdb.cpp}::mTagNames, anonymous_namespace{itemdb.cpp}::mTags, normalize(), parseSpriteName(), MissileInfo::particle, SpriteDisplay::particles, paths, readItemStatsString(), reportAlways, XML::Document::rootNode(), MissileInfo::speed, ItemDbType::SPRITE_HAIR, ItemDbType::SPRITE_RACE, STD_MOVE, ItemDbType::UNUSABLE, ItemDbType::USABLE, useButton2FromItemType(), useButtonFromItemType(), UseVirtFs_true, and MissileInfo::z.
void ItemDB::unload | ( | ) |
Definition at line 759 of file itemdb.cpp.
References delete2, delete_all(), Logger::log1(), logger, anonymous_namespace{itemdb.cpp}::mItemInfos, anonymous_namespace{itemdb.cpp}::mLoaded, anonymous_namespace{itemdb.cpp}::mNamedItemInfos, anonymous_namespace{itemdb.cpp}::mTagNames, anonymous_namespace{itemdb.cpp}::mTags, and anonymous_namespace{itemdb.cpp}::mUnknown.
Referenced by DbManager::unloadDb().