OpenMiner/include/inventory/Inventory.hpp
2018-06-21 13:05:05 +02:00

41 lines
866 B
C++

/*
* =====================================================================================
*
* Filename: Inventory.hpp
*
* Description:
*
* Created: 21/06/2018 00:59:26
*
* Author: Quentin Bazin, <quent42340@gmail.com>
*
* =====================================================================================
*/
#ifndef INVENTORY_HPP_
#define INVENTORY_HPP_
#include <vector>
#include "Types.hpp"
class Inventory {
public:
Inventory(u16 width, u16 height)
: m_width(width), m_height(height) { m_items.resize(width * height); }
void setItem(u16 x, u16 y, u16 id);
u16 width() const { return m_width; }
u16 height() const { return m_height; }
const std::vector<u16> &items() const { return m_items; }
private:
u16 m_width = 0;
u16 m_height = 0;
std::vector<u16> m_items;
};
#endif // INVENTORY_HPP_