| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #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
- {
- 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;
- };
|