Clang-format (#3028)

* 1/3 Add .clang-format file and travis compilation check

* 2/3 Run clang-format

* 3/3 Fix compilation problems due to include reordering

* 3bis/3 AfterControlStatement: false
This commit is contained in:
ctrlaltca 2018-01-27 10:41:32 +01:00 committed by GitHub
parent 8dbdd24c8e
commit b29bd9e070
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
272 changed files with 13378 additions and 9535 deletions

View file

@ -1,12 +1,12 @@
#ifndef SERVER_ABSTRACTUSERINTERFACE
#define SERVER_ABSTRACTUSERINTERFACE
#include <QMutex>
#include <QMap>
#include <QPair>
#include "serverinfo_user_container.h"
#include "pb/server_message.pb.h"
#include "pb/response.pb.h"
#include "pb/server_message.pb.h"
#include "serverinfo_user_container.h"
#include <QMap>
#include <QMutex>
#include <QPair>
class SessionEvent;
class GameEventContainer;
@ -16,31 +16,44 @@ class ResponseContainer;
class Server;
class Server_Game;
class Server_AbstractUserInterface : public ServerInfo_User_Container {
class Server_AbstractUserInterface : public ServerInfo_User_Container
{
private:
mutable QMutex gameListMutex;
QMap<int, QPair<int, int> > games; // gameId -> (roomId, playerId)
QMap<int, QPair<int, int>> games; // gameId -> (roomId, playerId)
protected:
Server *server;
public:
Server_AbstractUserInterface(Server *_server) : server(_server) { }
Server_AbstractUserInterface(Server *_server, const ServerInfo_User_Container &other) : ServerInfo_User_Container(other), server(_server) { }
virtual ~Server_AbstractUserInterface() { }
Server_AbstractUserInterface(Server *_server) : server(_server)
{
}
Server_AbstractUserInterface(Server *_server, const ServerInfo_User_Container &other)
: ServerInfo_User_Container(other), server(_server)
{
}
virtual ~Server_AbstractUserInterface()
{
}
virtual int getLastCommandTime() const = 0;
void playerRemovedFromGame(Server_Game *game);
void playerAddedToGame(int gameId, int roomId, int playerId);
void joinPersistentGames(ResponseContainer &rc);
QMap<int, QPair<int, int> > getGames() const { QMutexLocker locker(&gameListMutex); return games; }
QMap<int, QPair<int, int>> getGames() const
{
QMutexLocker locker(&gameListMutex);
return games;
}
virtual void sendProtocolItem(const Response &item) = 0;
virtual void sendProtocolItem(const SessionEvent &item) = 0;
virtual void sendProtocolItem(const GameEventContainer &item) = 0;
virtual void sendProtocolItem(const RoomEvent &item) = 0;
void sendProtocolItemByType(ServerMessage::MessageType type, const ::google::protobuf::Message &item);
static SessionEvent *prepareSessionEvent(const ::google::protobuf::Message &sessionEvent);
void sendResponseContainer(const ResponseContainer &responseContainer, Response::ResponseCode responseCode);
};