| 1 | // This file is part of Dust Racing 2D. |
| 2 | // Copyright (C) 2018 Jussi Lind <[email protected]> |
| 3 | // |
| 4 | // Dust Racing 2D is free software: you can redistribute it and/or modify |
| 5 | // it under the terms of the GNU General Public License as published by |
| 6 | // the Free Software Foundation, either version 3 of the License, or |
| 7 | // (at your option) any later version. |
| 8 | // Dust Racing 2D is distributed in the hope that it will be useful, |
| 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | // GNU General Public License for more details. |
| 12 | // |
| 13 | // You should have received a copy of the GNU General Public License |
| 14 | // along with Dust Racing 2D. If not, see <http://www.gnu.org/licenses/>. |
| 15 | |
| 16 | #include "draganddropstore.hpp" |
| 17 | |
| 18 | DragAndDropStore::DragAndDropStore() |
| 19 | { |
| 20 | } |
| 21 | |
| 22 | void DragAndDropStore::clear() |
| 23 | { |
| 24 | m_dragAndDropSourceTile = nullptr; |
| 25 | |
| 26 | m_dragAndDropObject = nullptr; |
| 27 | |
| 28 | m_dragAndDropTargetNode = nullptr; |
| 29 | } |
| 30 | |
| 31 | void DragAndDropStore::setDragAndDropSourceTile(TrackTile * tile) |
| 32 | { |
| 33 | m_dragAndDropSourceTile = tile; |
| 34 | } |
| 35 | |
| 36 | TrackTile * DragAndDropStore::dragAndDropSourceTile() const |
| 37 | { |
| 38 | return m_dragAndDropSourceTile; |
| 39 | } |
| 40 | |
| 41 | void DragAndDropStore::setDragAndDropObject(Object * object) |
| 42 | { |
| 43 | m_dragAndDropObject = object; |
| 44 | } |
| 45 | |
| 46 | Object * DragAndDropStore::dragAndDropObject() const |
| 47 | { |
| 48 | return m_dragAndDropObject; |
| 49 | } |
| 50 | |
| 51 | void DragAndDropStore::setDragAndDropTargetNode(TargetNode * tnode) |
| 52 | { |
| 53 | m_dragAndDropTargetNode = tnode; |
| 54 | } |
| 55 | |
| 56 | TargetNode * DragAndDropStore::dragAndDropTargetNode() const |
| 57 | { |
| 58 | return m_dragAndDropTargetNode; |
| 59 | } |
| 60 | |
| 61 | void DragAndDropStore::setDragAndDropSourcePos(QPointF pos) |
| 62 | { |
| 63 | m_dragAndDropSourcePos = pos; |
| 64 | } |
| 65 | |
| 66 | QPointF DragAndDropStore::dragAndDropSourcePos() const |
| 67 | { |
| 68 | return m_dragAndDropSourcePos; |
| 69 | } |