source:
network-game/common/Common.h@
0693e25
Last change on this file since 0693e25 was 0693e25, checked in by , 11 years ago | |
---|---|
|
|
File size: 657 bytes |
Rev | Line | |
---|---|---|
[3b1efcc] | 1 | #ifndef _COMMON_H |
2 | #define _COMMON_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 <fcntl.h> | |
11 | #include <assert.h> | |
12 | #endif | |
[edfd1d0] | 13 | |
[d05086b] | 14 | #include <string> |
15 | ||
16 | using namespace std; | |
17 | ||
[0693e25] | 18 | struct FLOAT_POSITION; |
[edfd1d0] | 19 | |
[0693e25] | 20 | struct POSITION { |
[edfd1d0] | 21 | int x; |
22 | int y; | |
[0693e25] | 23 | FLOAT_POSITION toFloat(); |
24 | }; | |
[b07eeac] | 25 | |
[0693e25] | 26 | struct FLOAT_POSITION { |
27 | float x; | |
28 | float y; | |
29 | POSITION toInt(); | |
30 | }; | |
[3b1efcc] | 31 | |
[b07eeac] | 32 | void set_nonblock(int sock); |
33 | unsigned long long getCurrentMillis(); | |
[d05086b] | 34 | string getCurrentDateTimeString(); |
[0693e25] | 35 | |
36 | POSITION screenToMap(POSITION pos); | |
37 | POSITION mapToScreen(POSITION pos); | |
[b07eeac] | 38 | float posDistance(FLOAT_POSITION pos1, FLOAT_POSITION pos2); |
[60017fc] | 39 | |
[3b1efcc] | 40 | #endif |
Note:
See TracBrowser
for help on using the repository browser.