2018-06-23 23:05:36 +02:00
|
|
|
/*
|
|
|
|
* =====================================================================================
|
|
|
|
*
|
|
|
|
* Filename: Item.hpp
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
*
|
|
|
|
* Created: 23/06/2018 22:29:41
|
|
|
|
*
|
|
|
|
* Author: Quentin Bazin, <quent42340@gmail.com>
|
|
|
|
*
|
|
|
|
* =====================================================================================
|
|
|
|
*/
|
|
|
|
#ifndef ITEM_HPP_
|
|
|
|
#define ITEM_HPP_
|
|
|
|
|
2018-06-25 22:30:38 +02:00
|
|
|
#include <string>
|
|
|
|
|
2018-06-25 18:42:50 +02:00
|
|
|
#include "IntTypes.hpp"
|
2018-06-25 18:12:15 +02:00
|
|
|
#include "ItemType.hpp"
|
2018-06-23 23:05:36 +02:00
|
|
|
|
|
|
|
class Item {
|
|
|
|
public:
|
2018-06-25 22:30:38 +02:00
|
|
|
Item(u32 id, u32 textureID, const std::string &name);
|
|
|
|
|
|
|
|
const std::string &name() const { return m_name; }
|
2018-06-23 23:05:36 +02:00
|
|
|
|
|
|
|
u32 id() const { return m_id; }
|
2018-06-25 16:32:32 +02:00
|
|
|
u32 textureID() const { return m_textureID; }
|
|
|
|
|
|
|
|
bool isBlock() const { return m_isBlock; }
|
2018-06-29 08:56:59 +02:00
|
|
|
bool isFuel() const { return m_isFuel; }
|
|
|
|
void setIsFuel(bool isFuel) { m_isFuel = isFuel; }
|
|
|
|
|
|
|
|
u16 burnTime() const { return m_burnTime; }
|
|
|
|
void setBurnTime(u16 burnTime) { m_burnTime = burnTime; }
|
2018-06-23 23:05:36 +02:00
|
|
|
|
2018-06-25 18:12:15 +02:00
|
|
|
protected:
|
|
|
|
bool m_isBlock = false;
|
2018-06-29 08:56:59 +02:00
|
|
|
bool m_isFuel = false;
|
|
|
|
|
|
|
|
u16 m_burnTime = 0;
|
2018-06-25 18:12:15 +02:00
|
|
|
|
2018-06-23 23:05:36 +02:00
|
|
|
private:
|
2018-06-25 22:30:38 +02:00
|
|
|
std::string m_name;
|
|
|
|
|
2018-06-23 23:05:36 +02:00
|
|
|
u32 m_id = 0;
|
2018-06-25 16:32:32 +02:00
|
|
|
u32 m_textureID = 0;
|
2018-06-23 23:05:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ITEM_HPP_
|