File indexing completed on 2024-05-12 05:39:29

0001 /***************************************************************************
0002  *   Copyright (C) 2015 by Renaud Guezennec                                *
0003  *   https://rolisteam.org/contact                   *
0004  *                                                                         *
0005  *   rolisteam is free software; you can redistribute it and/or modify     *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 2 of the License, or     *
0008  *   (at your option) any later version.                                   *
0009  *                                                                         *
0010  *   This program is distributed in the hope that it will be useful,       *
0011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0013  *   GNU General Public License for more details.                          *
0014  *                                                                         *
0015  *   You should have received a copy of the GNU General Public License     *
0016  *   along with this program; if not, write to the                         *
0017  *   Free Software Foundation, Inc.,                                       *
0018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
0019  ***************************************************************************/
0020 #include "startingnode.h"
0021 #include <QDebug>
0022 
0023 StartingNode::StartingNode() {}
0024 void StartingNode::run(ExecutionNode*)
0025 {
0026     m_previousNode= nullptr;
0027     if(nullptr != m_nextNode)
0028     {
0029         m_nextNode->run(this);
0030     }
0031 }
0032 QString StartingNode::toString(bool withlabel) const
0033 {
0034     if(withlabel)
0035     {
0036         return QString("%1 [label=\"StartingNode\"]").arg(m_id);
0037     }
0038     else
0039     {
0040         return m_id;
0041     }
0042 }
0043 
0044 qint64 StartingNode::getPriority() const
0045 {
0046     qint64 priority= 0;
0047     if(nullptr != m_nextNode)
0048     {
0049         priority= m_nextNode->getPriority();
0050     }
0051     return priority;
0052 }
0053 ExecutionNode* StartingNode::getCopy() const
0054 {
0055     StartingNode* node= new StartingNode();
0056     if(nullptr != m_nextNode)
0057     {
0058         node->setNextNode(m_nextNode->getCopy());
0059     }
0060     return node;
0061 }