| 1 | // This file is part of Dust Racing 2D. |
| 2 | // Copyright (C) 2011 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 "tracktilebase.hpp" |
| 17 | |
| 18 | TrackTileBase::TrackTileBase( |
| 19 | QPointF location, |
| 20 | QPoint matrixLocation, |
| 21 | const QString & type) |
| 22 | : m_tileType(type) |
| 23 | , m_location(location) |
| 24 | , m_matrixLocation(matrixLocation) |
| 25 | , m_computerHint(TrackTileBase::ComputerHint::None) |
| 26 | , m_excludeFromMinimap(false) |
| 27 | { |
| 28 | } |
| 29 | |
| 30 | QPointF TrackTileBase::location() const |
| 31 | { |
| 32 | return m_location; |
| 33 | } |
| 34 | |
| 35 | void TrackTileBase::setLocation(QPointF location) |
| 36 | { |
| 37 | m_location = location; |
| 38 | } |
| 39 | |
| 40 | QPoint TrackTileBase::matrixLocation() const |
| 41 | { |
| 42 | return m_matrixLocation; |
| 43 | } |
| 44 | |
| 45 | void TrackTileBase::setMatrixLocation(QPoint matrixLocation) |
| 46 | { |
| 47 | m_matrixLocation = matrixLocation; |
| 48 | } |
| 49 | |
| 50 | void TrackTileBase::setTileType(const QString & type) |
| 51 | { |
| 52 | if (type != m_tileType) |
| 53 | { |
| 54 | m_tileType = type; |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | const QString & TrackTileBase::tileType() const |
| 59 | { |
| 60 | return m_tileType; |
| 61 | } |
| 62 | |
| 63 | size_t TrackTileBase::width() |
| 64 | { |
| 65 | return 256; |
| 66 | } |
| 67 | |
| 68 | size_t TrackTileBase::height() |
| 69 | { |
| 70 | return 256; |
| 71 | } |
| 72 | |
| 73 | void TrackTileBase::setComputerHint(TrackTileBase::ComputerHint hint) |
| 74 | { |
| 75 | m_computerHint = hint; |
| 76 | } |
| 77 | |
| 78 | TrackTileBase::ComputerHint TrackTileBase::computerHint() const |
| 79 | { |
| 80 | return m_computerHint; |
| 81 | } |
| 82 | |
| 83 | void TrackTileBase::setExcludeFromMinimap(bool exclude) |
| 84 | { |
| 85 | m_excludeFromMinimap = exclude; |
| 86 | } |
| 87 | |
| 88 | bool TrackTileBase::excludeFromMinimap() const |
| 89 | { |
| 90 | return m_excludeFromMinimap; |
| 91 | } |
| 92 | |
| 93 | TrackTileBase::~TrackTileBase() |
| 94 | { |
| 95 | } |