1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00
vcmi/client/Client.h
Michał W. Urbańczyk 6613955463 * hero placed in the town starts as visiting hero, not garrisoned
* if hero doesn't have a spell book, he can buy one in a mage guild
* improvements in closing
* fixed crash on picking artifact
* added event message when picking artifact
* fixed problems with disappearing pikemen
* InfoWindow will be properly centered
* hero portraits again visible in PreGame
* fixed problems with handling Pandora's Box
* support for Campfires
* minor changes
2008-08-25 10:25:16 +00:00

56 lines
891 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 close();
void process(int what);
void run();
friend class CCallback;
friend class CScriptCallback;
};