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-12-29 02:23:23 +01:00
|
|
|
#include <gk/core/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-12-28 08:36:56 +01:00
|
|
|
Item(u32 id, u32 textureID, const std::string &name, const std::string &label);
|
2018-06-25 22:30:38 +02:00
|
|
|
|
2018-12-28 08:36:56 +01:00
|
|
|
const std::string &name() const { return m_name; }
|
2018-12-28 06:57:34 +01:00
|
|
|
const std::string &label() const { return m_label; }
|
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-12-28 21:23:26 +01:00
|
|
|
void setIsBlock(bool isBlock) { m_isBlock = 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-29 21:55:47 +02:00
|
|
|
u8 harvestCapability() const { return m_harvestCapability; }
|
|
|
|
void setHarvestCapability(u8 harvestCapability) { m_harvestCapability = harvestCapability; }
|
|
|
|
|
|
|
|
float miningSpeed() const { return m_miningSpeed; }
|
|
|
|
void setMiningSpeed(float miningSpeed) { m_miningSpeed = miningSpeed; }
|
|
|
|
|
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:
|
|
|
|
u32 m_id = 0;
|
2018-06-25 16:32:32 +02:00
|
|
|
u32 m_textureID = 0;
|
2018-06-29 21:55:47 +02:00
|
|
|
|
2018-12-28 08:36:56 +01:00
|
|
|
std::string m_name;
|
2018-12-28 06:57:34 +01:00
|
|
|
std::string m_label;
|
|
|
|
|
2018-06-29 21:55:47 +02:00
|
|
|
u8 m_harvestCapability = 0;
|
|
|
|
float m_miningSpeed = 1;
|
2018-06-23 23:05:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ITEM_HPP_
|