source: network-game/common/Player.h@ 7b43385

Last change on this file since 7b43385 was ca44f82, checked in by dportnoy <dmp1488@…>, 12 years ago

Updated files to correctly compile on Windows

  • Property mode set to 100644
File size: 740 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
17using namespace std;
18
19class Player {
20public:
21 Player();
22 Player(const Player& p);
23 Player(string name, string password);
24 Player(string name, sockaddr_in addr); // this will be deleted
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 void move();
35
36 int id;
37 string name;
38 string password;
39 sockaddr_in addr;
40 FLOAT_POSITION pos;
41 POSITION target;
42 unsigned long long timeLastUpdated;
43};
44
45#endif
Note: See TracBrowser for help on using the repository browser.