2012-08-06 13:10:16 -07:00
|
|
|
|
2012-06-14 06:06:06 -07:00
|
|
|
#pragma once
|
|
|
|
|
2012-08-06 13:10:16 -07:00
|
|
|
#include "cBlockEntity.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-14 06:06:06 -07:00
|
|
|
|
|
|
|
class cWindow;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-06 13:10:16 -07:00
|
|
|
/**
|
|
|
|
Implements the base behavior expected from a class that can handle UI windows for block entities.
|
|
|
|
*/
|
2012-06-14 06:06:06 -07:00
|
|
|
class cWindowOwner
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
cWindowOwner() : m_Window( NULL ) {}
|
|
|
|
void CloseWindow() { m_Window = NULL; }
|
|
|
|
void OpenWindow( cWindow* a_Window ) { m_Window = a_Window; }
|
|
|
|
|
|
|
|
cWindow* GetWindow() { return m_Window; }
|
|
|
|
|
2012-08-06 13:10:16 -07:00
|
|
|
void SetEntity(cBlockEntity * a_Entity) { m_Entity = a_Entity; }
|
|
|
|
void GetBlockPos(int & a_BlockX, int & a_BlockY, int & a_BlockZ)
|
|
|
|
{
|
|
|
|
a_BlockX = m_Entity->GetPosX();
|
|
|
|
a_BlockY = m_Entity->GetPosY();
|
|
|
|
a_BlockZ = m_Entity->GetPosZ();
|
|
|
|
}
|
|
|
|
|
2012-06-14 06:06:06 -07:00
|
|
|
private:
|
2012-08-06 13:10:16 -07:00
|
|
|
cWindow * m_Window;
|
|
|
|
cBlockEntity * m_Entity;
|
2012-06-14 06:06:06 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|