Add Alot
This commit is contained in:
51
Game/Inventory/PlayerInventory.h
Normal file
51
Game/Inventory/PlayerInventory.h
Normal file
@@ -0,0 +1,51 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
|
||||
#include "GridSystem/WorldTile.h"
|
||||
|
||||
|
||||
enum class InventoryItem {
|
||||
Empty,
|
||||
Bronzium,
|
||||
Diamond,
|
||||
Einsteinium,
|
||||
Emerald,
|
||||
Goldium,
|
||||
Ironium,
|
||||
Platinum,
|
||||
Platnium,
|
||||
Ruby,
|
||||
Silverium,
|
||||
Special,
|
||||
};
|
||||
|
||||
struct ItemStack {
|
||||
ItemStack(InventoryItem type, int quantity) : m_ItemType{ type }, m_Quantity{ quantity } {}
|
||||
InventoryItem m_ItemType;
|
||||
int m_Quantity{ 0 };
|
||||
};
|
||||
|
||||
class PlayerInventory final {
|
||||
public:
|
||||
PlayerInventory();
|
||||
~PlayerInventory();
|
||||
|
||||
PlayerInventory(PlayerInventory& other) = delete;
|
||||
PlayerInventory& operator=(PlayerInventory& other) = delete;
|
||||
PlayerInventory(PlayerInventory&& other) = delete;
|
||||
PlayerInventory& operator=(PlayerInventory&& other) = delete;
|
||||
|
||||
void ClearInventory();
|
||||
int GetTotalValue() const;
|
||||
void AddItem(const ItemStack& item);
|
||||
void RemoveItem(ItemStack* item);
|
||||
std::vector<ItemStack*> GetItems() const;
|
||||
InventoryItem GetItemByType(GroundTileType* tile);
|
||||
static std::string GetItemName(InventoryItem item);
|
||||
static int GetItemValue(InventoryItem item);
|
||||
static Texture* GetItemIcon(InventoryItem item);
|
||||
|
||||
|
||||
private:
|
||||
std::vector<ItemStack*> m_Items;
|
||||
};
|
||||
Reference in New Issue
Block a user