summaryrefslogtreecommitdiff
path: root/src/net/manaserv/inventoryhandler.h
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 16:07:54 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 16:07:54 +0100
commit5afe88df2538274859a162ffd63ed52118e80c19 (patch)
treeb610dfd58dc748fd63f49565b2a43eea2316714f /src/net/manaserv/inventoryhandler.h
parent73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6 (diff)
downloadmana-5afe88df2538274859a162ffd63ed52118e80c19.tar.gz
mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.bz2
mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.xz
mana-5afe88df2538274859a162ffd63ed52118e80c19.zip
Apply C++11 fixits
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
Diffstat (limited to 'src/net/manaserv/inventoryhandler.h')
-rw-r--r--src/net/manaserv/inventoryhandler.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/net/manaserv/inventoryhandler.h b/src/net/manaserv/inventoryhandler.h
index 808acb96..3659286b 100644
--- a/src/net/manaserv/inventoryhandler.h
+++ b/src/net/manaserv/inventoryhandler.h
@@ -38,25 +38,25 @@ class EquipBackend : public Equipment::Backend, public EventListener
public:
EquipBackend();
- ~EquipBackend();
+ ~EquipBackend() override;
- Item *getEquipment(int slotIndex) const;
- std::string getSlotName(int slotIndex) const;
- void clear();
+ Item *getEquipment(int slotIndex) const override;
+ std::string getSlotName(int slotIndex) const override;
+ void clear() override;
void equip(int itemId, int slotTypeId, int amountUsed = 1,
int itemInstance = 0);
void unequip(int slotTypeId);
- void event(Event::Channel channel, const Event &event);
+ void event(Event::Channel channel, const Event &event) override;
- int getSlotNumber() const
+ int getSlotNumber() const override
{ return mSlots.size(); }
unsigned int getVisibleSlotsNumber() const
{ return mVisibleSlots; }
- void triggerUnequip(int slotIndex) const;
+ void triggerUnequip(int slotIndex) const override;
bool isWeaponSlot(int slotTypeId) const;
bool isAmmoSlot(int slotTypeId) const;
@@ -66,13 +66,13 @@ class EquipBackend : public Equipment::Backend, public EventListener
const std::string& getBoxBackground(unsigned int slotIndex) const;
private:
- void readEquipFile();
+ void readEquipFile() override;
void readBoxNode(xmlNodePtr slotNode);
struct Slot {
Slot():
- item(0),
+ item(nullptr),
slotTypeId(0),
subId(0),
itemInstance(0),
@@ -113,7 +113,7 @@ class EquipBackend : public Equipment::Backend, public EventListener
unsigned int mVisibleSlots;
// slot client index, slot info
- typedef std::map<unsigned int, Slot> Slots;
+ using Slots = std::map<unsigned int, Slot>;
Slots mSlots;
std::vector<Position> mBoxesPositions;
std::vector<std::string> mBoxesBackgroundFile;
@@ -125,27 +125,27 @@ class InventoryHandler : public MessageHandler, Net::InventoryHandler,
public:
InventoryHandler();
- void handleMessage(MessageIn &msg);
+ void handleMessage(MessageIn &msg) override;
- void event(Event::Channel channel, const Event &event);
+ void event(Event::Channel channel, const Event &event) override;
- bool canSplit(const Item *item);
+ bool canSplit(const Item *item) override;
- size_t getSize(int type) const;
+ size_t getSize(int type) const override;
- bool isWeaponSlot(unsigned int slotTypeId) const
+ bool isWeaponSlot(unsigned int slotTypeId) const override
{ return mEquipBackend.isWeaponSlot(slotTypeId); }
- bool isAmmoSlot(unsigned int slotTypeId) const
+ bool isAmmoSlot(unsigned int slotTypeId) const override
{ return mEquipBackend.isAmmoSlot(slotTypeId); }
- unsigned int getVisibleSlotsNumber() const
+ unsigned int getVisibleSlotsNumber() const override
{ return mEquipBackend.getVisibleSlotsNumber(); }
- Position getBoxPosition(unsigned int slotIndex) const
+ Position getBoxPosition(unsigned int slotIndex) const override
{ return mEquipBackend.getBoxPosition(slotIndex); }
- const std::string& getBoxBackground(unsigned int slotIndex) const
+ const std::string& getBoxBackground(unsigned int slotIndex) const override
{ return mEquipBackend.getBoxBackground(slotIndex); }
private: