summaryrefslogtreecommitdiffstats
path: root/pacman-c++/util.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2011-05-05 00:57:07 +0200
committermanuel <manuel@mausz.at>2011-05-05 00:57:07 +0200
commitce48af53646cd9e7ec762fc1ac176b3aa620b11d (patch)
treef8fbf2cae8c7d0cbac2696a8f4cf94410bfb4928 /pacman-c++/util.h
parente54ccad07e256ba877bd41d70bd358bd0085bd1e (diff)
downloadfoop-ce48af53646cd9e7ec762fc1ac176b3aa620b11d.tar.gz
foop-ce48af53646cd9e7ec762fc1ac176b3aa620b11d.tar.bz2
foop-ce48af53646cd9e7ec762fc1ac176b3aa620b11d.zip
- refactorized the whole project and made a few subprojects
- replaced tcp with enet - added connect dialog - some smaller bugfixes
Diffstat (limited to 'pacman-c++/util.h')
-rw-r--r--pacman-c++/util.h37
1 files changed, 0 insertions, 37 deletions
diff --git a/pacman-c++/util.h b/pacman-c++/util.h
deleted file mode 100644
index d20eaa5..0000000
--- a/pacman-c++/util.h
+++ /dev/null
@@ -1,37 +0,0 @@
1#ifndef UTIL_H
2#define UTIL_H
3
4#include "constants.h"
5#include "actor.h"
6#include "pacman.pb.h"
7
8class QTcpSocket;
9
10namespace Util
11{
12 Transmission::map_t createUninitialisedMap();
13 Transmission::map_t createDemoMap();
14 void placeActors(Transmission::map_t map, unsigned int players, const Color::Color *colors);
15 void fillPoints(Transmission::map_t map, Transmission::field_t type = Transmission::point);
16 Transmission::map_t createEmptyMap();
17 void deleteMap(Transmission::map_t map);
18
19 Transmission::field_t actorMovementToTransmission(Actor::Movement mov,
20 Transmission::field_t def = Transmission::none);
21 Actor::Movement transmissionMovementToActor(Transmission::field_t field,
22 Actor::Movement def = Actor::None);
23 const QString colorToString(Color::Color color);
24
25 /* send packet with error check and flush */
26 QSharedPointer<QByteArray> createPacket(const ::google::protobuf::MessageLite& packet);
27 bool sendPacket(QByteArray *data, QTcpSocket *socket);
28 bool sendPacket(const ::google::protobuf::MessageLite& packet, QTcpSocket *socket);
29 QSharedPointer<QByteArray> receivePacket(QTcpSocket *socket);
30
31 int floorLog2(unsigned int n);
32
33#if 0
34 void hexdump(void *pAddressIn, long lSize);
35#endif
36}
37#endif // UTIL_H