Debian Codegraph @

src/common/targetnodebase.cpp

raw symbols SCIP
1 // This file is part of Dust Racing 2D.
2 // Copyright (C) 2012 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 "targetnodebase.hpp"
17 #include "tracktilebase.hpp"
18
19 TargetNodeBase::TargetNodeBase()
20 : m_size(QSize(static_cast<int>(TrackTileBase::height()), static_cast<int>(TrackTileBase::width())))
21 , m_index(-1)
22 {
23 }
24
25 void TargetNodeBase::setNext(TargetNodeBasePtr nextNode)
26 {
27 m_next = nextNode;
28 }
29
30 TargetNodeBasePtr TargetNodeBase::next() const
31 {
32 return m_next;
33 }
34
35 void TargetNodeBase::setPrev(TargetNodeBasePtr prevNode)
36 {
37 m_prev = prevNode;
38 }
39
40 TargetNodeBasePtr TargetNodeBase::prev() const
41 {
42 return m_prev;
43 }
44
45 QPointF TargetNodeBase::location() const
46 {
47 return m_location;
48 }
49
50 void TargetNodeBase::setLocation(QPointF newLocation)
51 {
52 m_location = newLocation;
53 }
54
55 int TargetNodeBase::index() const
56 {
57 return m_index;
58 }
59
60 void TargetNodeBase::setIndex(int index)
61 {
62 m_index = index;
63 }
64
65 void TargetNodeBase::setSize(QSizeF size)
66 {
67 m_size = size;
68 }
69
70 QSizeF TargetNodeBase::size() const
71 {
72 return m_size;
73 }