Added GUI as parameter for client thread constructor. Fixed linux header for getaddrinfo.

This commit is contained in:
lotodore
2007-02-18 00:10:26 +00:00
parent 296399f166
commit fc25ae5a8b
4 changed files with 18 additions and 6 deletions
+10 -2
View File
@@ -26,8 +26,8 @@
using namespace std;
ClientThread::ClientThread()
: m_curState(NULL)
ClientThread::ClientThread(GuiInterface &gui)
: m_curState(NULL), m_gui(gui)
{
m_data.reset(new ClientData);
m_curState = &CLIENT_INITIAL_STATE::Instance();
@@ -53,6 +53,7 @@ ClientThread::Main()
{
while (!ShouldTerminate())
{
GetState().Process(*this, m_gui);
}
}
@@ -70,6 +71,13 @@ ClientThread::GetData()
return *m_data;
}
ClientState &
ClientThread::GetState()
{
assert(m_curState);
return *m_curState;
}
void
ClientThread::SetState(ClientState &newState)
{