source: network-game/common/Player.h@ 876add0

Last change on this file since 876add0 was 74b8e79, checked in by dportnoy <dmp1488@…>, 11 years ago

Deleted some commented code

  • Property mode set to 100644
File size: 874 bytes
Line 
1#ifndef _PLAYER_H
2#define _PLAYER_H
3
4#include "Compiler.h"
5
6#if defined WINDOWS
7 #include <winsock2.h>
8 #include <WS2tcpip.h>
9#elif defined LINUX
10 #include <netinet/in.h>
11#endif
12
13#include <string>
14
15#include "Common.h"
16#include "WorldMap.h"
17
18using namespace std;
19
20class Player {
21public:
22 Player();
23 Player(const Player& p);
24 Player(string name, string password);
25
26 ~Player();
27
28 void serialize(char* buffer);
29 void deserialize(char* buffer);
30
31 void setId(int id);
32 void setAddr(sockaddr_in addr);
33
34 bool move(WorldMap *map);
35
36 void takeFlag(int flag, WorldMap *map);
37 void dropFlag(int flag, WorldMap *map);
38
39 int id;
40 string name;
41 string password;
42 sockaddr_in addr;
43 FLOAT_POSITION pos;
44 POSITION target;
45 unsigned long long timeLastUpdated;
46
47 int team; // 0 is blue, 1 is red
48 bool hasBlueFlag;
49 bool hasRedFlag;
50};
51
52#endif
Note: See TracBrowser for help on using the repository browser.