Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
MapDBEntrySpriteItem Struct Reference

A map sprite that is a pick-up item (type ITEM). More...

#include <mapdbentryspriteitem.h>

Inheritance diagram for MapDBEntrySpriteItem:
Collaboration diagram for MapDBEntrySpriteItem:

Public Member Functions

virtual SpriteType type () const
 < Item name given.
const QString getItem () const
ItemDBEntrygetToItem () const
Public Member Functions inherited from MapDBEntrySprite
int adjustedX () const
int adjustedY () const
const QString getSprite () const
int getX () const
int getY () const
const QString getMove () const
int getText () const
int getRange () const
const QString getFace () const
int getMissable () const
MissableDBEntrygetToMissable () const
SpriteDBEntrygetToSprite () const
MapDBEntrygetParent () const
void qmlProtect (const QQmlEngine *const engine) const
 Pin to C++ ownership.

Protected Member Functions

 MapDBEntrySpriteItem (const QJsonValue &data, MapDBEntry *const parent)
 Build from JSON under parent.
virtual void deepLink ()
 Resolve the item link.
virtual void qmlRegister () const
 Register with QML.
Protected Member Functions inherited from MapDBEntrySprite
 MapDBEntrySprite ()
 Empty entry.
 MapDBEntrySprite (const QJsonValue &data, MapDBEntry *const parent)
 Build from JSON under parent.

Protected Attributes

QString item = ""
 Item name (read via getItem()).
ItemDBEntrytoItem = nullptr
 Resolved item (deepLink).
Protected Attributes inherited from MapDBEntrySprite
QString sprite
 Sprite name (read via getSprite()).
int x = 0
 Raw X.
int y = 0
 Raw Y.
QString move = ""
 Movement mode (see note).
int text = -1
 Interaction text id.
int range = -1
 Wander range (exclusive with face).
QString face = ""
 Static facing (exclusive with range).
int missable = -1
 Missable index, or -1.
MissableDBEntrytoMissable = nullptr
 Resolved missable (deepLink).
SpriteDBEntrytoSprite = nullptr
 Resolved sprite picture (deepLink).
MapDBEntryparent = nullptr
 Owning map.

Friends

class MapsDB
class MapDBEntry

Additional Inherited Members

Public Types inherited from MapDBEntrySprite
enum  SpriteType {
  NPC , ITEM , POKEMON , TRAINER ,
  ERROR
}
 < X adjusted for Gen 1 placement. More...

Detailed Description

A map sprite that is a pick-up item (type ITEM).

Adds the item it gives (resolved to toItem in deepLink) to the common MapDBEntrySprite base. type() returns ITEM. See db.md.

See also
MapDBEntrySprite (base), ItemDBEntry.

Definition at line 32 of file mapdbentryspriteitem.h.

Constructor & Destructor Documentation

◆ MapDBEntrySpriteItem()

MapDBEntrySpriteItem::MapDBEntrySpriteItem ( const QJsonValue & data,
MapDBEntry *const parent )
protected

Build from JSON under parent.

Definition at line 29 of file mapdbentryspriteitem.cpp.

References item, MapDBEntry, MapDBEntrySprite::MapDBEntrySprite(), MapDBEntrySprite::parent, and qmlRegister().

Member Function Documentation

◆ deepLink()

void MapDBEntrySpriteItem::deepLink ( )
protectedvirtual

Resolve the item link.

Reimplemented from MapDBEntrySprite.

Definition at line 37 of file mapdbentryspriteitem.cpp.

References MapDBEntrySprite::deepLink(), ItemsDB::getInd(), ItemsDB::inst(), item, and toItem.

◆ getItem()

const QString MapDBEntrySpriteItem::getItem ( ) const
See also
getItem property.

Definition at line 65 of file mapdbentryspriteitem.cpp.

References item.

◆ getToItem()

ItemDBEntry * MapDBEntrySpriteItem::getToItem ( ) const
See also
getToItem property.

Definition at line 60 of file mapdbentryspriteitem.cpp.

References toItem.

◆ qmlRegister()

void MapDBEntrySpriteItem::qmlRegister ( ) const
protectedvirtual

Register with QML.

Reimplemented from MapDBEntrySprite.

Definition at line 75 of file mapdbentryspriteitem.cpp.

Referenced by MapDBEntrySpriteItem().

◆ type()

MapDBEntrySpriteItem::SpriteType MapDBEntrySpriteItem::type ( ) const
virtual

< Item name given.

Resolved item. Returns ITEM.

Reimplemented from MapDBEntrySprite.

Definition at line 70 of file mapdbentryspriteitem.cpp.

References MapDBEntrySprite::ITEM.

◆ MapDBEntry

friend class MapDBEntry
friend

Definition at line 54 of file mapdbentryspriteitem.h.

References MapDBEntry.

Referenced by MapDBEntry, and MapDBEntrySpriteItem().

◆ MapsDB

friend class MapsDB
friend

Definition at line 53 of file mapdbentryspriteitem.h.

References MapsDB.

Referenced by MapsDB.

Member Data Documentation

◆ item

QString MapDBEntrySpriteItem::item = ""
protected

Item name (read via getItem()).

Definition at line 50 of file mapdbentryspriteitem.h.

Referenced by deepLink(), getItem(), and MapDBEntrySpriteItem().

◆ toItem

ItemDBEntry* MapDBEntrySpriteItem::toItem = nullptr
protected

Resolved item (deepLink).

Definition at line 52 of file mapdbentryspriteitem.h.

Referenced by deepLink(), and getToItem().


The documentation for this struct was generated from the following files: