-
Notifications
You must be signed in to change notification settings - Fork 1
/
NetPlayer.h
55 lines (41 loc) · 1.04 KB
/
NetPlayer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef NetPlayerH
#define NetPlayerH
#include "Player.h"
#include <sysdefs.h> // äëÿ dstring.h
#include <vcl/dstring.h>
/*
òóò çàþçàåì LocalPlayer
class TClientNetPlayer : public TDraftPlayer
{
public:
TClientNetPlayer(string aName, bool aLog);
virtual void Pick(TCardPile& Booster);
};*/
namespace Scktcomp {
class TCustomWinSocket;
}
// âðåìÿ äëÿ ðåêîííåêòà
#define TIMEOUT 30
class TServerNetPlayer : public TDraftPlayer
{
public:
TServerNetPlayer(
string aName,
bool aLog,
Scktcomp::TCustomWinSocket *aSocket);
~TServerNetPlayer();
virtual void Pick(TCardPile& Booster);
// àêñåñîðû ñîêåòà. Íóëåâîé ñîêåò - çíà÷èò, êëèåíò îòâàëèëñÿ.
Scktcomp::TCustomWinSocket* GetSocket() const { return Socket; };
void SetSocket(Scktcomp::TCustomWinSocket*);
// ñîêåòíûå ôóíêöèè
AnsiString Buffer;
void OnReceiveText(AnsiString Text);
bool UsedByFactory;
private:
Scktcomp::TCustomWinSocket *Socket;
TCardPile Booster;
bool PickReceived;
int PickIndex;
};
#endif