source: network-game/common/Player.h@ 093c141

Last change on this file since 093c141 was 60017fc, checked in by dportnoy <dmp1488@…>, 12 years ago

Added code for player movement

  • Property mode set to 100644
File size: 752 bytes
RevLine 
[2488852]1#ifndef _PLAYER_H
2#define _PLAYER_H
3
[4c202e0]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
[2488852]13#include <string>
[60017fc]14#include <sys/time.h>
[2488852]15
[edfd1d0]16#include "Common.h"
17
[2488852]18using namespace std;
19
[8e540f4]20class Player {
[2488852]21public:
[01d0d00]22 Player();
23 Player(const Player& p);
[59061f6]24 Player(string name, string password);
25 Player(string name, sockaddr_in addr); // this will be deleted
[01d0d00]26
[8e540f4]27 ~Player();
[2488852]28
[3b8adee]29 void serialize(char* buffer);
30 void deserialize(char* buffer);
31
[01d0d00]32 void setId(int id);
[59061f6]33 void setAddr(sockaddr_in addr);
34
[60017fc]35 void move();
36
[01d0d00]37 int id;
[8e540f4]38 string name;
[59061f6]39 string password;
[8e540f4]40 sockaddr_in addr;
[60017fc]41 FLOAT_POSITION pos;
42 POSITION target;
43 timespec timeLastUpdated;
[2488852]44};
45
46#endif
Note: See TracBrowser for help on using the repository browser.