2018-06-21 00:55:38 +02:00
|
|
|
/*
|
|
|
|
* =====================================================================================
|
|
|
|
*
|
|
|
|
* Filename: WorkbenchWidget.hpp
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
*
|
|
|
|
* Created: 20/06/2018 23:22:08
|
|
|
|
*
|
|
|
|
* Author: Quentin Bazin, <quent42340@gmail.com>
|
|
|
|
*
|
|
|
|
* =====================================================================================
|
|
|
|
*/
|
|
|
|
#ifndef WORKBENCHWIDGET_HPP_
|
|
|
|
#define WORKBENCHWIDGET_HPP_
|
|
|
|
|
2018-06-21 01:32:55 +02:00
|
|
|
#include "InventoryWidget.hpp"
|
2018-06-21 00:55:38 +02:00
|
|
|
|
2018-06-21 09:00:53 +02:00
|
|
|
class WorkbenchWidget : public Widget {
|
2018-06-21 00:55:38 +02:00
|
|
|
public:
|
2018-06-23 03:26:34 +02:00
|
|
|
WorkbenchWidget(Inventory &playerInventory, Inventory &hotbarInventory, Widget *parent = nullptr);
|
2018-06-21 00:55:38 +02:00
|
|
|
|
|
|
|
void onEvent(const SDL_Event &event);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void draw(RenderTarget &target, RenderStates states) const override;
|
|
|
|
|
|
|
|
Image m_background;
|
|
|
|
|
2018-06-23 01:32:23 +02:00
|
|
|
Inventory m_craftingInventory{3, 3};
|
|
|
|
InventoryWidget m_craftingInventoryWidget{this};
|
|
|
|
|
2018-06-23 03:26:34 +02:00
|
|
|
Inventory &m_playerInventory;
|
|
|
|
InventoryWidget m_playerInventoryWidget{this};
|
2018-06-23 01:32:23 +02:00
|
|
|
|
2018-06-23 03:26:34 +02:00
|
|
|
Inventory &m_hotbarInventory;
|
2018-06-23 01:32:23 +02:00
|
|
|
InventoryWidget m_hotbarInventoryWidget{this};
|
|
|
|
|
|
|
|
MouseItemWidget m_mouseItemWidget{this};
|
2018-06-21 00:55:38 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // WORKBENCHWIDGET_HPP_
|