2012-07-15 16:36:34 -04:00
|
|
|
#pragma once
|
|
|
|
#include "Block.h"
|
2012-07-16 15:20:37 -04:00
|
|
|
#include "../cCraftingWindow.h"
|
|
|
|
#include "../cPlayer.h"
|
2012-07-15 16:36:34 -04:00
|
|
|
|
|
|
|
class cBlockWorkbenchHandler : public cBlockHandler
|
|
|
|
{
|
|
|
|
public:
|
2012-07-16 15:20:37 -04:00
|
|
|
cBlockWorkbenchHandler(BLOCKTYPE a_BlockID)
|
|
|
|
: cBlockHandler(a_BlockID)
|
|
|
|
{
|
|
|
|
}
|
2012-07-15 16:36:34 -04:00
|
|
|
|
2012-08-19 06:44:19 -04:00
|
|
|
virtual void OnUse(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z) override
|
2012-07-16 15:20:37 -04:00
|
|
|
{
|
|
|
|
cWindow* Window = new cCraftingWindow(0, true);
|
|
|
|
a_Player->OpenWindow(Window);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual bool IsUseable() override
|
2012-07-15 16:36:34 -04:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
};
|