File indexing completed on 2023-10-01 08:02:04
0001 /* 0002 SPDX-FileCopyrightText: 2007-2008 Thomas Gallinari <tg8187@yahoo.fr> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "cell.h" 0008 #include "element.h" 0009 0010 const qreal Cell::SIZE = 20.0; 0011 0012 Cell::Cell() 0013 : m_type(Cell::WALL) 0014 , m_element(nullptr) 0015 , m_cost(0) 0016 , m_parent(nullptr) 0017 { 0018 } 0019 0020 Cell::~Cell() 0021 { 0022 m_element = nullptr; 0023 delete m_element; 0024 } 0025 0026 Cell::Type Cell::getType() const 0027 { 0028 return m_type; 0029 } 0030 0031 void Cell::setType(Cell::Type p_type) 0032 { 0033 m_type = p_type; 0034 } 0035 0036 Element *Cell::getElement() const 0037 { 0038 return m_element; 0039 } 0040 0041 void Cell::setElement(Element *p_element) 0042 { 0043 m_element = p_element; 0044 } 0045 0046 int Cell::getCost() const 0047 { 0048 return m_cost; 0049 } 0050 0051 void Cell::setCost(const int p_cost) 0052 { 0053 m_cost = p_cost; 0054 } 0055 0056 Cell *Cell::getParent() const 0057 { 0058 return m_parent; 0059 } 0060 0061 void Cell::setParent(Cell *p_parent) 0062 { 0063 m_parent = p_parent; 0064 }