Code: Select all
class myTerrain
{
......
myTerrain::setbrush()
{
}
}
class CGame
{
myTerrain* d_terrain;
void CGame::handleBrushShape(const CEGUI::EventArgs& e)
{
d_terrain.setbrush();
}
......
void CGame::init()
{
......
winMgr.getWindow("GameGUI/HumanInfo/Close")->subscribeEvent(
CEGUI::Window::EventMouseButtonDown,
CEGUI::Event::Subscriber(&CGame::handleBrushShape, this));
......
}
}
I want to separate handleBrushShape() from CGame,such as:
Code: Select all
class myTerrain
{
myTerrain::setbrush()
{
}
......
myTerrain::handleBrushShape(const CEGUI::EventArgs& e)
{
......
setbrush();
}
}
class CGame
{
myTerrain* d_terrain;
void CGame::handleBrushShape(const CEGUI::EventArgs& e)
{
......
d_terrain.setbrush();
}
......
void CGame::init()
{
......
winMgr.getWindow("GameGUI/HumanInfo/Close")->subscribeEvent(
CEGUI::Window::EventMouseButtonDown,
CEGUI::Event::Subscriber(??????, this));
......
}
}
How can I write in "??????".
Can I write "&(myTerrain->handleBrushShape())" or "&myTerrain::handleBrushShape"?