1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00
vcmi/client/Client.h
Michał W. Urbańczyk b89c951d09 * version set to 0.62
* almost redone treasure chest
* working gaining levels for heroes (including dialog with skill selection)
* corrected another typo i cr_shots
2008-08-13 00:44:31 +00:00

55 lines
875 B
C++

#pragma once
#include "../global.h"
#include <boost/thread.hpp>
struct StartInfo;
class CGameState;
class CGameInterface;
class CConnection;
class CCallback;
namespace boost
{
class mutex;
class condition_variable;
}
template <typename T>
struct CSharedCond
{
boost::mutex *mx;
boost::condition_variable *cv;
T *res;
CSharedCond(T*R)
{
res = R;
mx = new boost::mutex;
cv = new boost::condition_variable;
}
~CSharedCond()
{
delete res;
delete mx;
delete cv;
}
};
class CClient
{
CCallback *cb;
CGameState *gs;
std::map<ui8,CGameInterface *> playerint;
CConnection *serv;
void waitForMoveAndSend(int color);
public:
CClient(void);
CClient(CConnection *con, StartInfo *si);
~CClient(void);
void process(int what);
void run();
friend class CCallback;
friend class CScriptCallback;
};