source:
network-game/common/Common.h@
64d22ac
Last change on this file since 64d22ac was b07eeac, checked in by , 11 years ago | |
---|---|
|
|
File size: 635 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 | |
[b07eeac] | 14 | typedef struct |
15 | { | |
16 | float x; | |
17 | float y; | |
18 | } FLOAT_POSITION; | |
[edfd1d0] | 19 | |
20 | typedef struct | |
[3b1efcc] | 21 | { |
[edfd1d0] | 22 | int x; |
23 | int y; | |
[b07eeac] | 24 | //FLOAT_POSITION toFloat(); |
25 | FLOAT_POSITION toFloat() { | |
26 | FLOAT_POSITION floatPosition; | |
27 | floatPosition.x = x; | |
28 | floatPosition.y = y; | |
29 | ||
30 | return floatPosition; | |
31 | } | |
[62ee2ce] | 32 | } POSITION; |
[3b1efcc] | 33 | |
[b07eeac] | 34 | void set_nonblock(int sock); |
35 | unsigned long long getCurrentMillis(); | |
36 | float posDistance(FLOAT_POSITION pos1, FLOAT_POSITION pos2); | |
[60017fc] | 37 | |
[3b1efcc] | 38 | #endif |
Note:
See TracBrowser
for help on using the repository browser.