source: network-game/common/Common.h@ 3794f6d

Last change on this file since 3794f6d was b07eeac, checked in by dportnoy <dmp1488@…>, 11 years ago

Players pick up flags when they get close to the flag objects, not the structres. When a flag is picked up, a REMOVE_OBJECT message is sent

  • Property mode set to 100644
File size: 635 bytes
RevLine 
[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]14typedef struct
15{
16 float x;
17 float y;
18} FLOAT_POSITION;
[edfd1d0]19
20typedef 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]34void set_nonblock(int sock);
35unsigned long long getCurrentMillis();
36float posDistance(FLOAT_POSITION pos1, FLOAT_POSITION pos2);
[60017fc]37
[3b1efcc]38#endif
Note: See TracBrowser for help on using the repository browser.