diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-29 14:30:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-29 14:30:20 +0300 |
commit | 0f9ec2061c4ad6157c3186f1cab9c4d8558980b5 (patch) | |
tree | 6259593b8436178ad8d981a96a8fd71eab9e04cc /src/gui | |
parent | 01773c71a4698c6f01fe70d864f922bda65506cb (diff) | |
download | mv-0f9ec2061c4ad6157c3186f1cab9c4d8558980b5.tar.gz mv-0f9ec2061c4ad6157c3186f1cab9c4d8558980b5.tar.bz2 mv-0f9ec2061c4ad6157c3186f1cab9c4d8558980b5.tar.xz mv-0f9ec2061c4ad6157c3186f1cab9c4d8558980b5.zip |
Add strong typed int type BeingId.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 34 | ||||
-rw-r--r-- | src/gui/popups/popupmenu.h | 9 | ||||
-rw-r--r-- | src/gui/viewport.cpp | 2 | ||||
-rw-r--r-- | src/gui/viewport.h | 4 | ||||
-rw-r--r-- | src/gui/widgets/tabs/debugwindowtabs.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/buydialog.cpp | 22 | ||||
-rw-r--r-- | src/gui/windows/buydialog.h | 5 | ||||
-rw-r--r-- | src/gui/windows/buyingstoreselldialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/buyingstoreselldialog.h | 6 | ||||
-rw-r--r-- | src/gui/windows/buyselldialog.cpp | 8 | ||||
-rw-r--r-- | src/gui/windows/buyselldialog.h | 5 | ||||
-rw-r--r-- | src/gui/windows/charcreatedialog.cpp | 4 | ||||
-rw-r--r-- | src/gui/windows/charselectdialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/charselectdialog.h | 2 | ||||
-rw-r--r-- | src/gui/windows/npcdialog.cpp | 17 | ||||
-rw-r--r-- | src/gui/windows/npcdialog.h | 12 | ||||
-rw-r--r-- | src/gui/windows/npcselldialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/npcselldialog.h | 6 |
18 files changed, 83 insertions, 61 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index dd48da369..ee34d4ff7 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -98,8 +98,8 @@ PopupMenu::PopupMenu() : mBrowserBox(new BrowserBox(this, BrowserBox::AUTO_SIZE, true, "popupbrowserbox.xml")), mScrollArea(nullptr), - mBeingId(0), - mFloorItemId(0), + mBeingId(BeingId_zero), + mFloorItemId(BeingId_zero), mItem(nullptr), mItemId(0), mItemColor(1), @@ -389,7 +389,7 @@ bool PopupMenu::addBeingMenu() if (!being) return false; - BeingInfo *const info = NPCDB::get(being->getSubType()); + BeingInfo *const info = NPCDB::get(fromInt(being->getSubType(), BeingId)); if (!info) return false; @@ -456,7 +456,7 @@ void PopupMenu::showPlayerPopup(const std::string &nick) setMousePos(); mNick = nick; - mBeingId = 0; + mBeingId = BeingId_zero; mType = ActorType::Player; mBrowserBox->clearRows(); @@ -931,8 +931,8 @@ void PopupMenu::showChangePos(const int x, const int y) } else { - mBeingId = 0; - mFloorItemId = 0; + mBeingId = BeingId_zero; + mFloorItemId = BeingId_zero; mItem = nullptr; mMapItem = nullptr; mNick.clear(); @@ -1109,7 +1109,7 @@ void PopupMenu::handleLink(const std::string &link, if (chatWindow) chatWindow->copyToClipboard(mX, mY); } - else if (link == "npc clipboard" && mBeingId) + else if (link == "npc clipboard" && mBeingId != BeingId_zero) { NpcDialog::copyToClipboard(mBeingId, mX, mY); } @@ -1474,7 +1474,7 @@ void PopupMenu::handleLink(const std::string &link, { if (actorManager) { - mBeingId = atoi(link.substr(7).c_str()); + mBeingId = fromInt(atoi(link.substr(7).c_str()), BeingId); being = actorManager->findBeing(mBeingId); if (being) { @@ -1487,8 +1487,9 @@ void PopupMenu::handleLink(const std::string &link, { if (actorManager) { - const int id = atoi(link.substr(10).c_str()); - if (id) + const BeingId id = fromInt(atoi( + link.substr(10).c_str()), BeingId); + if (id != BeingId_zero) { const FloorItem *const item = actorManager->findItem(id); if (item) @@ -1548,8 +1549,8 @@ void PopupMenu::handleLink(const std::string &link, replaceAll(cmd, "'NAME'", mNick); replaceAll(cmd, "'X'", toString(mX)); replaceAll(cmd, "'Y'", toString(mY)); - replaceAll(cmd, "'BEINGID'", toString(mBeingId)); - replaceAll(cmd, "'FLOORID'", toString(mFloorItemId)); + replaceAll(cmd, "'BEINGID'", toString(toInt(mBeingId, int))); + replaceAll(cmd, "'FLOORID'", toString(toInt(mFloorItemId, int))); replaceAll(cmd, "'ITEMID'", toString(mItemId)); replaceAll(cmd, "'ITEMCOLOR'", toString(mItemColor)); replaceAll(cmd, "'BEINGTYPEID'", toString(static_cast<int>(mType))); @@ -1583,8 +1584,8 @@ void PopupMenu::handleLink(const std::string &link, setVisible(Visible_false); - mBeingId = 0; - mFloorItemId = 0; + mBeingId = BeingId_zero; + mFloorItemId = BeingId_zero; mItem = nullptr; mItemId = 0; mItemColor = 1; @@ -2188,7 +2189,8 @@ void PopupMenu::showWindowsPopup() showPopup(mX, mY); } -void PopupMenu::showNpcDialogPopup(const int npcId, const int x, const int y) +void PopupMenu::showNpcDialogPopup(const BeingId npcId, + const int x, const int y) { mBeingId = npcId; mX = x; @@ -2625,7 +2627,7 @@ void PopupMenu::showGMPopup() // TRANSLATORS: popup menu item // TRANSLATORS: revive player mBrowserBox->addRow("revive", _("Revive")); - if (mBeingId) + if (mBeingId != BeingId_zero) { // TRANSLATORS: popup menu item // TRANSLATORS: kick player diff --git a/src/gui/popups/popupmenu.h b/src/gui/popups/popupmenu.h index 5d6420662..e1f9b3ba7 100644 --- a/src/gui/popups/popupmenu.h +++ b/src/gui/popups/popupmenu.h @@ -25,6 +25,8 @@ #include "enums/inventorytype.h" +#include "enums/simpletypes/beingid.h" + #include "gui/widgets/linkhandler.h" #include "gui/widgets/popup.h" @@ -140,7 +142,8 @@ class PopupMenu final : public Popup, public LinkHandler void showWindowsPopup(); - void showNpcDialogPopup(const int npcId, const int x, const int y); + void showNpcDialogPopup(const BeingId npcId, + const int x, const int y); void showWindowPopup(Window *const window); @@ -198,8 +201,8 @@ class PopupMenu final : public Popup, public LinkHandler BrowserBox *mBrowserBox; ScrollArea *mScrollArea; - int mBeingId; - int mFloorItemId; + BeingId mBeingId; + BeingId mFloorItemId; Item *mItem; int mItemId; unsigned char mItemColor; diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 196ac5d1c..e0ffd732f 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -920,7 +920,7 @@ void Viewport::moveCamera(const int dx, const int dy) mCameraRelativeY += dy; } -void Viewport::moveCameraToActor(const int actorId, +void Viewport::moveCameraToActor(const BeingId actorId, const int x, const int y) { if (!localPlayer || !actorManager) diff --git a/src/gui/viewport.h b/src/gui/viewport.h index 10a5b6643..e459afcae 100644 --- a/src/gui/viewport.h +++ b/src/gui/viewport.h @@ -25,6 +25,8 @@ #include "position.h" +#include "enums/simpletypes/beingid.h" + #include "gui/widgets/windowcontainer.h" #include "listeners/mouselistener.h" @@ -155,7 +157,7 @@ class Viewport final : public WindowContainer, void setCameraRelativeY(const int n) { mCameraRelativeY = n; } - void moveCameraToActor(const int actorId, + void moveCameraToActor(const BeingId actorId, const int x = 0, const int y = 0); diff --git a/src/gui/widgets/tabs/debugwindowtabs.cpp b/src/gui/widgets/tabs/debugwindowtabs.cpp index faccf9b2e..704f1a114 100644 --- a/src/gui/widgets/tabs/debugwindowtabs.cpp +++ b/src/gui/widgets/tabs/debugwindowtabs.cpp @@ -323,7 +323,7 @@ void TargetDebugTab::logic() mTargetIdLabel->setCaption(strprintf("%s %d", // TRANSLATORS: debug window label - _("Target Id:"), target->getId())); + _("Target Id:"), toInt(target->getId(), int))); mTargetTypeLabel->setCaption(strprintf("%s %d", // TRANSLATORS: debug window label _("Target type:"), target->getSubType())); diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp index 63925ff28..a77eed240 100644 --- a/src/gui/windows/buydialog.cpp +++ b/src/gui/windows/buydialog.cpp @@ -179,7 +179,7 @@ BuyDialog::BuyDialog() : mSortDropDown(nullptr), mFilterTextField(new TextField(this, "", true, this, "namefilter", true)), mFilterLabel(nullptr), - mNpcId(Items), + mNpcId(fromInt(Items, BeingId)), mMoney(0), mAmountItems(0), mMaxItems(0), @@ -188,7 +188,7 @@ BuyDialog::BuyDialog() : init(); } -BuyDialog::BuyDialog(const int npcId) : +BuyDialog::BuyDialog(const BeingId npcId) : // TRANSLATORS: buy dialog name Window(_("Buy"), Modal_false, nullptr, "buy.xml"), ActionListener(), @@ -216,7 +216,7 @@ BuyDialog::BuyDialog(std::string nick) : Modal_false, this, "sort")), mFilterTextField(new TextField(this, "", true, this, "namefilter", true)), mFilterLabel(nullptr), - mNpcId(Nick), + mNpcId(fromInt(Nick, BeingId)), mMoney(0), mAmountItems(0), mMaxItems(0), @@ -271,7 +271,7 @@ void BuyDialog::init() // You may change this symbol if your language uses another. mDecreaseButton = new Button(this, _("-"), "dec", this); // TRANSLATORS: buy dialog button - mBuyButton = new Button(this, mNpcId == Items + mBuyButton = new Button(this, mNpcId == fromInt(Items, BeingId) ? _("Create") :_("Buy"), "buy", this); // TRANSLATORS: buy dialog button mQuitButton = new Button(this, _("Quit"), "quit", this); @@ -406,7 +406,7 @@ void BuyDialog::sort() void BuyDialog::close() { - switch (mNpcId) + switch (toInt(mNpcId, int)) { case Nick: case Items: @@ -488,15 +488,15 @@ void BuyDialog::action(const ActionEvent &event) else if (eventId == "buy" && mAmountItems > 0 && mAmountItems <= mMaxItems) { ShopItem *const item = mShopItems->at(selectedItem); - if (mNpcId == Items) + if (mNpcId == fromInt(Items, BeingId)) { adminHandler->createItems(item->getId(), mAmountItems, item->getColor()); } - else if (mNpcId != Nick) + else if (mNpcId != fromInt(Nick, BeingId)) { #ifdef EATHENA_SUPPORT - if (mNpcId == Market) + if (mNpcId == fromInt(Market, BeingId)) { marketHandler->buyItem(item->getId(), item->getType(), @@ -505,7 +505,7 @@ void BuyDialog::action(const ActionEvent &event) item->increaseQuantity(-mAmountItems); item->update(); } - else if (mNpcId == Cash) + else if (mNpcId == fromInt(Cash, BeingId)) { cashShopHandler->buyItem(item->getPrice(), item->getId(), @@ -523,7 +523,7 @@ void BuyDialog::action(const ActionEvent &event) updateSlider(selectedItem); } - else if (mNpcId == Nick) + else if (mNpcId == fromInt(Nick, BeingId)) { #ifdef EATHENA_SUPPORT if (serverFeatures->haveVending()) @@ -594,7 +594,7 @@ void BuyDialog::updateButtonsAndLabels() const int itemPrice = item->getPrice(); // Calculate how many the player can afford - if (mNpcId == Items) + if (mNpcId == fromInt(Items, BeingId)) mMaxItems = 100; else if (itemPrice) mMaxItems = mMoney / itemPrice; diff --git a/src/gui/windows/buydialog.h b/src/gui/windows/buydialog.h index 8dea72886..bef09083e 100644 --- a/src/gui/windows/buydialog.h +++ b/src/gui/windows/buydialog.h @@ -23,6 +23,7 @@ #ifndef GUI_WINDOWS_BUYDIALOG_H #define GUI_WINDOWS_BUYDIALOG_H +#include "enums/simpletypes/beingid.h" #include "enums/simpletypes/visible.h" #include "gui/widgets/window.h" @@ -64,7 +65,7 @@ class BuyDialog final : public Window, * * @see Window::Window */ - explicit BuyDialog(const int npcId); + explicit BuyDialog(const BeingId npcId); /** * Constructor. @@ -175,7 +176,7 @@ class BuyDialog final : public Window, TextField *mFilterTextField; Label *mFilterLabel; - int mNpcId; + BeingId mNpcId; int mMoney; int mAmountItems; int mMaxItems; diff --git a/src/gui/windows/buyingstoreselldialog.cpp b/src/gui/windows/buyingstoreselldialog.cpp index 29b24f638..f99251eb0 100644 --- a/src/gui/windows/buyingstoreselldialog.cpp +++ b/src/gui/windows/buyingstoreselldialog.cpp @@ -37,7 +37,7 @@ #include "debug.h" -BuyingStoreSellDialog::BuyingStoreSellDialog(const int accountId, +BuyingStoreSellDialog::BuyingStoreSellDialog(const BeingId accountId, const int storeId) : SellDialog(true), mAccountId(accountId), diff --git a/src/gui/windows/buyingstoreselldialog.h b/src/gui/windows/buyingstoreselldialog.h index 9fb40cba0..ce5c404e4 100644 --- a/src/gui/windows/buyingstoreselldialog.h +++ b/src/gui/windows/buyingstoreselldialog.h @@ -25,6 +25,8 @@ #ifdef EATHENA_SUPPORT +#include "enums/simpletypes/beingid.h" + #include "gui/widgets/selldialog.h" class Being; @@ -42,7 +44,7 @@ class BuyingStoreSellDialog final : public SellDialog * * @see Window::Window */ - BuyingStoreSellDialog(const int accountId, + BuyingStoreSellDialog(const BeingId accountId, const int storeId); A_DELETE_COPY(BuyingStoreSellDialog) @@ -50,7 +52,7 @@ class BuyingStoreSellDialog final : public SellDialog protected: void sellAction(const ActionEvent &event) override final; - int mAccountId; + BeingId mAccountId; int mStoreId; }; diff --git a/src/gui/windows/buyselldialog.cpp b/src/gui/windows/buyselldialog.cpp index 15d4165f3..bdd28b000 100644 --- a/src/gui/windows/buyselldialog.cpp +++ b/src/gui/windows/buyselldialog.cpp @@ -35,7 +35,7 @@ BuySellDialog::DialogList BuySellDialog::dialogInstances; -BuySellDialog::BuySellDialog(const int npcId) : +BuySellDialog::BuySellDialog(const BeingId npcId) : // TRANSLATORS: shop window name Window(_("Shop"), Modal_false, nullptr, "buysell.xml"), ActionListener(), @@ -50,7 +50,7 @@ BuySellDialog::BuySellDialog(const std::string &nick) : // TRANSLATORS: shop window name Window(_("Shop"), Modal_false, nullptr, "buysell.xml"), ActionListener(), - mNpcId(-1), + mNpcId(BeingId_negOne), mNick(nick), mBuyButton(nullptr) { @@ -128,14 +128,14 @@ void BuySellDialog::action(const ActionEvent &event) const std::string &eventId = event.getId(); if (eventId == "Buy") { - if (mNpcId != -1) + if (mNpcId != BeingId_negOne) npcHandler->buy(mNpcId); else buySellHandler->requestSellList(mNick); } else if (eventId == "Sell") { - if (mNpcId != -1) + if (mNpcId != BeingId_negOne) npcHandler->sell(mNpcId); else buySellHandler->requestBuyList(mNick); diff --git a/src/gui/windows/buyselldialog.h b/src/gui/windows/buyselldialog.h index 573435846..dc7435126 100644 --- a/src/gui/windows/buyselldialog.h +++ b/src/gui/windows/buyselldialog.h @@ -23,6 +23,7 @@ #ifndef GUI_WINDOWS_BUYSELLDIALOG_H #define GUI_WINDOWS_BUYSELLDIALOG_H +#include "enums/simpletypes/beingid.h" #include "enums/simpletypes/visible.h" #include "gui/widgets/window.h" @@ -46,7 +47,7 @@ class BuySellDialog final : public Window, * * @see Window::Window */ - explicit BuySellDialog(const int npcId); + explicit BuySellDialog(const BeingId npcId); explicit BuySellDialog(const std::string &nick); @@ -78,7 +79,7 @@ class BuySellDialog final : public Window, typedef std::list<BuySellDialog*> DialogList; static DialogList dialogInstances; - int mNpcId; + BeingId mNpcId; std::string mNick; Button *mBuyButton; }; diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index 6ada41158..917cc51fb 100644 --- a/src/gui/windows/charcreatedialog.cpp +++ b/src/gui/windows/charcreatedialog.cpp @@ -122,7 +122,9 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent, mCreateButton(new Button(this, _("Create"), "create", this)), // TRANSLATORS: char create dialog button mCancelButton(new Button(this, _("Cancel"), "cancel", this)), - mPlayer(new Being(0, ActorType::Player, static_cast<uint16_t>(0U), + mPlayer(new Being(BeingId_zero, + ActorType::Player, + static_cast<uint16_t>(0U), nullptr)), mPlayerBox(new PlayerBox(this, mPlayer, "charcreate_playerbox.xml", "charcreate_selectedplayerbox.xml")), diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp index 5663ab387..bb4eae95e 100644 --- a/src/gui/windows/charselectdialog.cpp +++ b/src/gui/windows/charselectdialog.cpp @@ -634,7 +634,7 @@ void CharSelectDialog::updateState() } } -void CharSelectDialog::setName(const int id, const std::string &newName) +void CharSelectDialog::setName(const BeingId id, const std::string &newName) { for (unsigned int i = 0, sz = static_cast<unsigned int>( mCharacterEntries.size()); i < sz; ++i) diff --git a/src/gui/windows/charselectdialog.h b/src/gui/windows/charselectdialog.h index 9e9871c5a..53d41facb 100644 --- a/src/gui/windows/charselectdialog.h +++ b/src/gui/windows/charselectdialog.h @@ -89,7 +89,7 @@ class CharSelectDialog final : public Window, void postInit() override final; - void setName(const int id, const std::string &newName); + void setName(const BeingId id, const std::string &newName); private: void attemptCharacterDelete(const int index, diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index 2c7c27f57..c8ccd482e 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -81,7 +81,7 @@ NpcDialogs NpcDialog::mNpcDialogs; typedef std::vector<Image *>::iterator ImageVectorIter; -NpcDialog::NpcDialog(const int npcId) : +NpcDialog::NpcDialog(const BeingId npcId) : // TRANSLATORS: npc dialog name Window(_("NPC"), Modal_false, nullptr, "npc.xml"), ActionListener(), @@ -204,7 +204,8 @@ void NpcDialog::postInit() const Being *const being = actorManager->findBeing(mNpcId); if (being) { - showAvatar(NPCDB::getAvatarFor(being->getSubType())); + showAvatar(NPCDB::getAvatarFor(fromInt( + being->getSubType(), BeingId))); setCaption(being->getName()); } } @@ -861,13 +862,16 @@ void NpcDialog::restoreCamera() mCameraMode = -1; } -void NpcDialog::showAvatar(const uint16_t avatarId) +void NpcDialog::showAvatar(const BeingId avatarId) { - const bool needShow = (avatarId != 0); + const bool needShow = (avatarId != BeingId_zero); if (needShow) { delete mAvatarBeing; - mAvatarBeing = new Being(0, ActorType::Avatar, avatarId, nullptr); + mAvatarBeing = new Being(BeingId_zero, + ActorType::Avatar, + toInt(avatarId, uint16_t), + nullptr); mPlayerBox->setPlayer(mAvatarBeing); if (!mAvatarBeing->empty()) { @@ -973,7 +977,8 @@ void NpcDialog::mousePressed(MouseEvent &event) } } -void NpcDialog::copyToClipboard(const int npcId, const int x, const int y) +void NpcDialog::copyToClipboard(const BeingId npcId, + const int x, const int y) { NpcDialogs::iterator it = mNpcDialogs.find(npcId); if (it != mNpcDialogs.end()) diff --git a/src/gui/windows/npcdialog.h b/src/gui/windows/npcdialog.h index 0ed4096e8..378bbd5e9 100644 --- a/src/gui/windows/npcdialog.h +++ b/src/gui/windows/npcdialog.h @@ -23,6 +23,7 @@ #ifndef GUI_WINDOWS_NPCDIALOG_H #define GUI_WINDOWS_NPCDIALOG_H +#include "enums/simpletypes/beingid.h" #include "enums/simpletypes/visible.h" #include "gui/models/extendedlistmodel.h" @@ -44,7 +45,7 @@ class PlayerBox; class ScrollArea; class TextField; -typedef std::map<int, NpcDialog*> NpcDialogs; +typedef std::map<BeingId, NpcDialog*> NpcDialogs; /** * The npc dialog. @@ -62,7 +63,7 @@ class NpcDialog final : public Window, * * @see Window::Window */ - explicit NpcDialog(const int npcId); + explicit NpcDialog(const BeingId npcId); A_DELETE_COPY(NpcDialog) @@ -196,7 +197,7 @@ class NpcDialog final : public Window, void refocus(); - void showAvatar(const uint16_t avatarId); + void showAvatar(const BeingId avatarId); void setAvatarDirection(const uint8_t direction); @@ -211,7 +212,8 @@ class NpcDialog final : public Window, int isCloseState() const { return mActionState == NPC_ACTION_CLOSE; } - static void copyToClipboard(const int npcId, const int x, const int y); + static void copyToClipboard(const BeingId npcId, + const int x, const int y); static NpcDialogs mNpcDialogs; @@ -233,7 +235,7 @@ class NpcDialog final : public Window, void placeItemInputControls(); - int mNpcId; + BeingId mNpcId; int mDefaultInt; std::string mDefaultString; diff --git a/src/gui/windows/npcselldialog.cpp b/src/gui/windows/npcselldialog.cpp index 683593deb..c1fdbe259 100644 --- a/src/gui/windows/npcselldialog.cpp +++ b/src/gui/windows/npcselldialog.cpp @@ -41,7 +41,7 @@ #include "debug.h" -NpcSellDialog::NpcSellDialog(const int npcId) : +NpcSellDialog::NpcSellDialog(const BeingId npcId) : SellDialog(true), mNpcId(npcId) { diff --git a/src/gui/windows/npcselldialog.h b/src/gui/windows/npcselldialog.h index 1932ddf42..af611f8f1 100644 --- a/src/gui/windows/npcselldialog.h +++ b/src/gui/windows/npcselldialog.h @@ -23,6 +23,8 @@ #ifndef GUI_WINDOWS_NPCSELLDIALOG_H #define GUI_WINDOWS_NPCSELLDIALOG_H +#include "enums/simpletypes/beingid.h" + #include "gui/widgets/selldialog.h" /** @@ -38,7 +40,7 @@ class NpcSellDialog final : public SellDialog * * @see Window::Window */ - explicit NpcSellDialog(const int npcId); + explicit NpcSellDialog(const BeingId npcId); A_DELETE_COPY(NpcSellDialog) @@ -47,7 +49,7 @@ class NpcSellDialog final : public SellDialog protected: void sellAction(const ActionEvent &event) override final; - int mNpcId; + BeingId mNpcId; }; #endif // GUI_WINDOWS_NPCSELLDIALOG_H |