summaryrefslogtreecommitdiffstats
path: root/src/UI
diff options
context:
space:
mode:
Diffstat (limited to 'src/UI')
-rw-r--r--src/UI/SlotArea.cpp18
-rw-r--r--src/UI/SlotArea.h20
-rw-r--r--src/UI/Window.cpp2
-rw-r--r--src/UI/Window.h2
4 files changed, 21 insertions, 21 deletions
diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp
index dc89ff8d4..32a202f58 100644
--- a/src/UI/SlotArea.cpp
+++ b/src/UI/SlotArea.cpp
@@ -428,7 +428,7 @@ cSlotAreaChest::cSlotAreaChest(cChestEntity * a_Chest, cWindow & a_ParentWindow)
-const cItem * cSlotAreaChest::GetSlot(int a_SlotNum, cPlayer & a_Player) const
+const cItem * cSlotAreaChest::GetSlot(int a_SlotNum, const cPlayer & a_Player) const
{
// a_SlotNum ranges from 0 to 26, use that to index the chest entity's inventory directly:
return &(m_Chest->GetSlot(a_SlotNum));
@@ -461,7 +461,7 @@ cSlotAreaDoubleChest::cSlotAreaDoubleChest(cChestEntity * a_TopChest, cChestEnti
-const cItem * cSlotAreaDoubleChest::GetSlot(int a_SlotNum, cPlayer & a_Player) const
+const cItem * cSlotAreaDoubleChest::GetSlot(int a_SlotNum, const cPlayer & a_Player) const
{
// a_SlotNum ranges from 0 to 53, use that to index the correct chest's inventory:
if (a_SlotNum < 27)
@@ -1358,7 +1358,7 @@ void cSlotAreaBeacon::DistributeStack(cItem & a_ItemStack, cPlayer & a_Player, b
-const cItem * cSlotAreaBeacon::GetSlot(int a_SlotNum, cPlayer & a_Player) const
+const cItem * cSlotAreaBeacon::GetSlot(int a_SlotNum, const cPlayer & a_Player) const
{
UNUSED(a_Player);
return &(m_Beacon->GetSlot(a_SlotNum));
@@ -1669,7 +1669,7 @@ cSlotAreaEnderChest::cSlotAreaEnderChest(cEnderChestEntity * a_EnderChest, cWind
-const cItem * cSlotAreaEnderChest::GetSlot(int a_SlotNum, cPlayer & a_Player) const
+const cItem * cSlotAreaEnderChest::GetSlot(int a_SlotNum, const cPlayer & a_Player) const
{
return &(a_Player.GetEnderChestContents().GetSlot(a_SlotNum));
}
@@ -1886,7 +1886,7 @@ void cSlotAreaFurnace::DistributeStack(cItem & a_ItemStack, cPlayer & a_Player,
-const cItem * cSlotAreaFurnace::GetSlot(int a_SlotNum, cPlayer & a_Player) const
+const cItem * cSlotAreaFurnace::GetSlot(int a_SlotNum, const cPlayer & a_Player) const
{
UNUSED(a_Player);
// a_SlotNum ranges from 0 to 2, query the items from the underlying furnace:
@@ -2184,7 +2184,7 @@ cSlotAreaMinecartWithChest::cSlotAreaMinecartWithChest(cMinecartWithChest * a_Ch
-const cItem * cSlotAreaMinecartWithChest::GetSlot(int a_SlotNum, cPlayer & a_Player) const
+const cItem * cSlotAreaMinecartWithChest::GetSlot(int a_SlotNum, const cPlayer & a_Player) const
{
// a_SlotNum ranges from 0 to 26, use that to index the minecart chest entity's inventory directly:
UNUSED(a_Player);
@@ -2242,7 +2242,7 @@ void cSlotAreaInventoryBase::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAc
-const cItem * cSlotAreaInventoryBase::GetSlot(int a_SlotNum, cPlayer & a_Player) const
+const cItem * cSlotAreaInventoryBase::GetSlot(int a_SlotNum, const cPlayer & a_Player) const
{
// a_SlotNum ranges from 0 to 35, map that to the player's inventory slots according to the internal offset
return &a_Player.GetInventory().GetSlot(a_SlotNum + m_SlotOffset);
@@ -2426,7 +2426,7 @@ cSlotAreaItemGrid::~cSlotAreaItemGrid()
-const cItem * cSlotAreaItemGrid::GetSlot(int a_SlotNum, cPlayer & a_Player) const
+const cItem * cSlotAreaItemGrid::GetSlot(int a_SlotNum, const cPlayer & a_Player) const
{
return &m_ItemGrid.GetSlot(a_SlotNum);
}
@@ -2466,7 +2466,7 @@ cSlotAreaTemporary::cSlotAreaTemporary(int a_NumSlots, cWindow & a_ParentWindow)
-const cItem * cSlotAreaTemporary::GetSlot(int a_SlotNum, cPlayer & a_Player) const
+const cItem * cSlotAreaTemporary::GetSlot(int a_SlotNum, const cPlayer & a_Player) const
{
cItemMap::const_iterator itr = m_Items.find(a_Player.GetUniqueID());
if (itr == m_Items.end())
diff --git a/src/UI/SlotArea.h b/src/UI/SlotArea.h
index 0ff36ce50..0d60c0b2f 100644
--- a/src/UI/SlotArea.h
+++ b/src/UI/SlotArea.h
@@ -37,7 +37,7 @@ public:
int GetNumSlots(void) const { return m_NumSlots; }
/** Called to retrieve an item in the specified slot for the specified player. Must return a valid cItem. */
- virtual const cItem * GetSlot(int a_SlotNum, cPlayer & a_Player) const = 0;
+ virtual const cItem * GetSlot(int a_SlotNum, const cPlayer & a_Player) const = 0;
/** Called to set an item in the specified slot for the specified player */
virtual void SetSlot(int a_SlotNum, cPlayer & a_Player, const cItem & a_Item) = 0;
@@ -100,7 +100,7 @@ public:
// Creative inventory's click handling is somewhat different from survival inventory's, handle that here:
virtual void Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickAction, const cItem & a_ClickedItem) override;
- virtual const cItem * GetSlot(int a_SlotNum, cPlayer & a_Player) const override;
+ virtual const cItem * GetSlot(int a_SlotNum, const cPlayer & a_Player) const override;
virtual void SetSlot(int a_SlotNum, cPlayer & a_Player, const cItem & a_Item) override;
protected:
@@ -180,7 +180,7 @@ public:
virtual ~cSlotAreaItemGrid();
- virtual const cItem * GetSlot(int a_SlotNum, cPlayer & a_Player) const override;
+ virtual const cItem * GetSlot(int a_SlotNum, const cPlayer & a_Player) const override;
virtual void SetSlot(int a_SlotNum, cPlayer & a_Player, const cItem & a_Item) override;
protected:
@@ -206,7 +206,7 @@ public:
cSlotAreaTemporary(int a_NumSlots, cWindow & a_ParentWindow);
// cSlotArea overrides:
- virtual const cItem * GetSlot (int a_SlotNum, cPlayer & a_Player) const override;
+ virtual const cItem * GetSlot (int a_SlotNum, const cPlayer & a_Player) const override;
virtual void SetSlot (int a_SlotNum, cPlayer & a_Player, const cItem & a_Item) override;
virtual void OnPlayerAdded (cPlayer & a_Player) override;
virtual void OnPlayerRemoved(cPlayer & a_Player) override;
@@ -330,7 +330,7 @@ public:
virtual void Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickAction, const cItem & a_ClickedItem) override;
virtual void DistributeStack(cItem & a_ItemStack, cPlayer & a_Player, bool a_ShouldApply, bool a_KeepEmptySlots, bool a_BackFill) override;
- virtual const cItem * GetSlot(int a_SlotNum, cPlayer & a_Player) const override;
+ virtual const cItem * GetSlot(int a_SlotNum, const cPlayer & a_Player) const override;
virtual void SetSlot(int a_SlotNum, cPlayer & a_Player, const cItem & a_Item) override;
protected:
@@ -381,7 +381,7 @@ class cSlotAreaChest :
public:
cSlotAreaChest(cChestEntity * a_Chest, cWindow & a_ParentWindow);
- virtual const cItem * GetSlot(int a_SlotNum, cPlayer & a_Player) const override;
+ virtual const cItem * GetSlot(int a_SlotNum, const cPlayer & a_Player) const override;
virtual void SetSlot(int a_SlotNum, cPlayer & a_Player, const cItem & a_Item) override;
protected:
@@ -398,7 +398,7 @@ class cSlotAreaDoubleChest :
public:
cSlotAreaDoubleChest(cChestEntity * a_TopChest, cChestEntity * a_BottomChest, cWindow & a_ParentWindow);
- virtual const cItem * GetSlot(int a_SlotNum, cPlayer & a_Player) const override;
+ virtual const cItem * GetSlot(int a_SlotNum, const cPlayer & a_Player) const override;
virtual void SetSlot(int a_SlotNum, cPlayer & a_Player, const cItem & a_Item) override;
protected:
@@ -416,7 +416,7 @@ class cSlotAreaEnderChest :
public:
cSlotAreaEnderChest(cEnderChestEntity * a_EnderChest, cWindow & a_ParentWindow);
- virtual const cItem * GetSlot(int a_SlotNum, cPlayer & a_Player) const override;
+ virtual const cItem * GetSlot(int a_SlotNum, const cPlayer & a_Player) const override;
virtual void SetSlot(int a_SlotNum, cPlayer & a_Player, const cItem & a_Item) override;
protected:
@@ -440,7 +440,7 @@ public:
virtual void Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickAction, const cItem & a_ClickedItem) override;
virtual void DistributeStack(cItem & a_ItemStack, cPlayer & a_Player, bool a_ShouldApply, bool a_KeepEmptySlots, bool a_BackFill) override;
- virtual const cItem * GetSlot(int a_SlotNum, cPlayer & a_Player) const override;
+ virtual const cItem * GetSlot(int a_SlotNum, const cPlayer & a_Player) const override;
virtual void SetSlot(int a_SlotNum, cPlayer & a_Player, const cItem & a_Item) override;
protected:
@@ -492,7 +492,7 @@ class cSlotAreaMinecartWithChest :
public:
cSlotAreaMinecartWithChest(cMinecartWithChest * a_ChestCart, cWindow & a_ParentWindow);
- virtual const cItem * GetSlot(int a_SlotNum, cPlayer & a_Player) const override;
+ virtual const cItem * GetSlot(int a_SlotNum, const cPlayer & a_Player) const override;
virtual void SetSlot(int a_SlotNum, cPlayer & a_Player, const cItem & a_Item) override;
protected:
diff --git a/src/UI/Window.cpp b/src/UI/Window.cpp
index d0b963e13..146131728 100644
--- a/src/UI/Window.cpp
+++ b/src/UI/Window.cpp
@@ -170,7 +170,7 @@ bool cWindow::IsSlotInPlayerInventory(int a_SlotNum) const
-void cWindow::GetSlots(cPlayer & a_Player, cItems & a_Slots) const
+void cWindow::GetSlots(const cPlayer & a_Player, cItems & a_Slots) const
{
a_Slots.clear();
a_Slots.reserve(static_cast<size_t>(GetNumSlots()));
diff --git a/src/UI/Window.h b/src/UI/Window.h
index 76d22a12c..675a83d92 100644
--- a/src/UI/Window.h
+++ b/src/UI/Window.h
@@ -108,7 +108,7 @@ public:
// tolua_end
/** Fills a_Slots with the slots read from m_SlotAreas[], for the specified player */
- void GetSlots(cPlayer & a_Player, cItems & a_Slots) const;
+ void GetSlots(const cPlayer & a_Player, cItems & a_Slots) const;
/** Handles a click event from a player */
void Clicked(