2018-06-21 01:32:55 +02:00
|
|
|
/*
|
|
|
|
* =====================================================================================
|
|
|
|
*
|
|
|
|
* Filename: ItemWidget.hpp
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
*
|
|
|
|
* Created: 21/06/2018 01:10:13
|
|
|
|
*
|
|
|
|
* Author: Quentin Bazin, <quent42340@gmail.com>
|
|
|
|
*
|
|
|
|
* =====================================================================================
|
|
|
|
*/
|
|
|
|
#ifndef ITEMWIDGET_HPP_
|
|
|
|
#define ITEMWIDGET_HPP_
|
|
|
|
|
|
|
|
#include "Image.hpp"
|
2018-06-21 09:00:53 +02:00
|
|
|
#include "Widget.hpp"
|
2018-06-21 01:32:55 +02:00
|
|
|
|
2018-06-21 09:00:53 +02:00
|
|
|
class ItemWidget : public Widget {
|
2018-06-21 01:32:55 +02:00
|
|
|
public:
|
2018-06-21 09:00:53 +02:00
|
|
|
ItemWidget(u16 id, Widget *parent = nullptr);
|
|
|
|
|
2018-06-21 12:55:31 +02:00
|
|
|
u16 item() const { return m_id; }
|
2018-06-21 09:00:53 +02:00
|
|
|
void setItem(u16 id);
|
2018-06-21 01:32:55 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
void draw(RenderTarget &target, RenderStates states) const override;
|
|
|
|
|
2018-06-21 12:55:31 +02:00
|
|
|
u16 m_id = 0;
|
|
|
|
|
2018-06-21 01:32:55 +02:00
|
|
|
Image m_image;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ITEMWIDGET_HPP_
|