2021-09-24 10:15:43 -04:00
|
|
|
#include "blockinfo.h"
|
|
|
|
#include <iostream>
|
|
|
|
|
2021-10-31 00:31:08 -04:00
|
|
|
BlockInfo::BlockInfo(BlockType type, const std::string& name, float u, float v, float s, int dur) : m_type(type), m_name(name), m_u(u), m_v(v), m_s(s), m_durability(dur)
|
2021-09-24 10:15:43 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
BlockInfo::~BlockInfo()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
BlockType BlockInfo::GetType() const
|
|
|
|
{
|
|
|
|
return m_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
void BlockInfo::SetDurability(int durability)
|
|
|
|
{
|
|
|
|
m_durability = durability;
|
|
|
|
}
|
|
|
|
|
|
|
|
int BlockInfo::GetDurability() const
|
|
|
|
{
|
|
|
|
return m_durability;
|
|
|
|
}
|
|
|
|
|
2021-10-31 00:31:08 -04:00
|
|
|
void BlockInfo::GetTexture(float& u, float& v, float& s)
|
|
|
|
{
|
|
|
|
u = m_u;
|
|
|
|
v = m_v;
|
|
|
|
s = m_s;
|
|
|
|
}
|
|
|
|
|
2021-09-24 10:15:43 -04:00
|
|
|
void BlockInfo::Show() const
|
|
|
|
{
|
|
|
|
std::cout << "Type: " << m_type << std::endl;
|
|
|
|
std::cout << "Nom: " << m_name << std::endl;
|
|
|
|
std::cout << "Durabilite: " << m_durability << std::endl;
|
2021-10-31 00:31:08 -04:00
|
|
|
std::cout << "Coordonnees Texture: " << m_u << ", " << m_v << ", " << m_s << std::endl;
|
2021-09-24 10:15:43 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|