mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
6613955463
* 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
56 lines
891 B
C++
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;
|
|
};
|