mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-01-26 03:14:44 -08:00
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:
@@ -1,8 +1,10 @@
|
||||
#include "server_response_containers.h"
|
||||
#include <google/protobuf/descriptor.h>
|
||||
#include "server_game.h"
|
||||
#include <google/protobuf/descriptor.h>
|
||||
|
||||
GameEventStorageItem::GameEventStorageItem(const ::google::protobuf::Message &_event, int _playerId, EventRecipients _recipients)
|
||||
GameEventStorageItem::GameEventStorageItem(const ::google::protobuf::Message &_event,
|
||||
int _playerId,
|
||||
EventRecipients _recipients)
|
||||
: event(new GameEvent), recipients(_recipients)
|
||||
{
|
||||
event->GetReflection()->MutableMessage(event, _event.GetDescriptor()->FindExtensionByName("ext"))->CopyFrom(_event);
|
||||
@@ -14,8 +16,7 @@ GameEventStorageItem::~GameEventStorageItem()
|
||||
delete event;
|
||||
}
|
||||
|
||||
GameEventStorage::GameEventStorage()
|
||||
: gameEventContext(0), privatePlayerId(0)
|
||||
GameEventStorage::GameEventStorage() : gameEventContext(0), privatePlayerId(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -30,10 +31,15 @@ void GameEventStorage::setGameEventContext(const ::google::protobuf::Message &_g
|
||||
{
|
||||
delete gameEventContext;
|
||||
gameEventContext = new GameEventContext;
|
||||
gameEventContext->GetReflection()->MutableMessage(gameEventContext, _gameEventContext.GetDescriptor()->FindExtensionByName("ext"))->CopyFrom(_gameEventContext);
|
||||
gameEventContext->GetReflection()
|
||||
->MutableMessage(gameEventContext, _gameEventContext.GetDescriptor()->FindExtensionByName("ext"))
|
||||
->CopyFrom(_gameEventContext);
|
||||
}
|
||||
|
||||
void GameEventStorage::enqueueGameEvent(const ::google::protobuf::Message &event, int playerId, GameEventStorageItem::EventRecipients recipients, int _privatePlayerId)
|
||||
void GameEventStorage::enqueueGameEvent(const ::google::protobuf::Message &event,
|
||||
int playerId,
|
||||
GameEventStorageItem::EventRecipients recipients,
|
||||
int _privatePlayerId)
|
||||
{
|
||||
gameEventList.append(new GameEventStorageItem(event, playerId, recipients));
|
||||
if (_privatePlayerId != -1)
|
||||
@@ -44,7 +50,7 @@ void GameEventStorage::sendToGame(Server_Game *game)
|
||||
{
|
||||
if (gameEventList.isEmpty())
|
||||
return;
|
||||
|
||||
|
||||
GameEventContainer *contPrivate = new GameEventContainer;
|
||||
GameEventContainer *contOthers = new GameEventContainer;
|
||||
for (int i = 0; i < gameEventList.size(); ++i) {
|
||||
@@ -63,8 +69,7 @@ void GameEventStorage::sendToGame(Server_Game *game)
|
||||
game->sendGameEventContainer(contOthers, GameEventStorageItem::SendToOthers, privatePlayerId);
|
||||
}
|
||||
|
||||
ResponseContainer::ResponseContainer(int _cmdId)
|
||||
: cmdId(_cmdId), responseExtension(0)
|
||||
ResponseContainer::ResponseContainer(int _cmdId) : cmdId(_cmdId), responseExtension(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user