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,10 +1,16 @@
#include <QGraphicsSceneMouseEvent>
#include "selectzone.h"
#include "gamescene.h"
#include "carditem.h"
#include "gamescene.h"
#include <QDebug>
#include <QGraphicsSceneMouseEvent>
SelectZone::SelectZone(Player *_player, const QString &_name, bool _hasCardAttr, bool _isShufflable, bool _contentsKnown, QGraphicsItem *parent, bool isView)
SelectZone::SelectZone(Player *_player,
const QString &_name,
bool _hasCardAttr,
bool _isShufflable,
bool _contentsKnown,
QGraphicsItem *parent,
bool isView)
: CardZone(_player, _name, _hasCardAttr, _isShufflable, _contentsKnown, parent, isView)
{
}
@ -22,7 +28,7 @@ void SelectZone::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
pos.setY(0);
if (pos.y() > br.height())
pos.setY(br.height());
QRectF selectionRect = QRectF(selectionOrigin, pos).normalized();
for (int i = 0; i < cards.size(); ++i) {
if (cards[i]->getAttachedTo())
@ -30,7 +36,8 @@ void SelectZone::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
continue;
cards[i]->setSelected(selectionRect.intersects(cards[i]->mapRectToParent(cards[i]->boundingRect())));
}
static_cast<GameScene *>(scene())->resizeRubberBand(deviceTransform(static_cast<GameScene *>(scene())->getViewportTransform()).map(pos));
static_cast<GameScene *>(scene())->resizeRubberBand(
deviceTransform(static_cast<GameScene *>(scene())->getViewportTransform()).map(pos));
event->accept();
}
}
@ -39,7 +46,7 @@ void SelectZone::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
if (event->button() == Qt::LeftButton) {
scene()->clearSelection();
selectionOrigin = event->pos();
static_cast<GameScene *>(scene())->startRubberBand(event->scenePos());
event->accept();
@ -53,4 +60,3 @@ void SelectZone::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
static_cast<GameScene *>(scene())->stopRubberBand();
event->accept();
}