File indexing completed on 2024-12-08 03:48:35

0001 /*
0002     This file is part of the KDE games lskat program
0003     SPDX-FileCopyrightText: 2006 Martin Heni <kde@heni-online.de>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #include "mouseinput.h"
0009 
0010 // Qt includes
0011 
0012 // KF includes
0013 
0014 // Constructor for the input
0015 MouseInput::MouseInput(QObject *parent)
0016     : AbstractInput(parent)
0017 {
0018 }
0019 
0020 // Mouse press received
0021 void MouseInput::mousePress(const QPoint &point)
0022 {
0023     int playerNumber;
0024     int cardNumber;
0025 
0026     // Do only process input if it is our turn
0027     if (!mInputAllowed) return;
0028 
0029     Q_EMIT signalConvertMousePress(point, playerNumber, cardNumber);
0030     // Check whether the move is for the right player
0031     if (playerNumber == mId)
0032     {
0033         //qCDebug(LSKAT_LOG) << "MouseInput:: Convert to " << playerNumber << "," << cardNumber;
0034         Q_EMIT signalPlayerInput(mId, playerNumber, cardNumber);
0035     }
0036 }
0037 
0038 #include "moc_mouseinput.cpp"