source:
network-game/common/Player.h@
ca44f82
| Last change on this file since ca44f82 was ca44f82, checked in by , 13 years ago | |
|---|---|
|
|
| File size: 740 bytes | |
| Rev | Line | |
|---|---|---|
| [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> |
| 14 | ||
| [edfd1d0] | 15 | #include "Common.h" |
| 16 | ||
| [2488852] | 17 | using namespace std; |
| 18 | ||
| [8e540f4] | 19 | class Player { |
| [2488852] | 20 | public: |
| [01d0d00] | 21 | Player(); |
| 22 | Player(const Player& p); | |
| [59061f6] | 23 | Player(string name, string password); |
| 24 | Player(string name, sockaddr_in addr); // this will be deleted | |
| [01d0d00] | 25 | |
| [8e540f4] | 26 | ~Player(); |
| [2488852] | 27 | |
| [3b8adee] | 28 | void serialize(char* buffer); |
| 29 | void deserialize(char* buffer); | |
| 30 | ||
| [01d0d00] | 31 | void setId(int id); |
| [59061f6] | 32 | void setAddr(sockaddr_in addr); |
| 33 | ||
| [60017fc] | 34 | void move(); |
| 35 | ||
| [01d0d00] | 36 | int id; |
| [8e540f4] | 37 | string name; |
| [59061f6] | 38 | string password; |
| [8e540f4] | 39 | sockaddr_in addr; |
| [60017fc] | 40 | FLOAT_POSITION pos; |
| 41 | POSITION target; | |
| [8f85180] | 42 | unsigned long long timeLastUpdated; |
| [2488852] | 43 | }; |
| 44 | ||
| 45 | #endif |
Note:
See TracBrowser
for help on using the repository browser.
![(please configure the [header_logo] section in trac.ini)](/medieval/chrome/site/your_project_logo.png)