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

0001 /*************************************************************************
0002  *   Copyright (C) 2009 by Renaud Guezennec                              *
0003  *                                                                       *
0004  *   https://rolisteam.org/                                           *
0005  *                                                                       *
0006  *   rolisteam is free software; you can redistribute it and/or modify   *
0007  *   it under the terms of the GNU General Public License as published   *
0008  *   by the Free Software Foundation; either version 2 of the License,   *
0009  *   or (at your option) any later version.                              *
0010  *                                                                       *
0011  *   This program is distributed in the hope that it will be useful,     *
0012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of      *
0013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the       *
0014  *   GNU General Public License for more details.                        *
0015  *                                                                       *
0016  *   You should have received a copy of the GNU General Public License   *
0017  *   along with this program; if not, write to the                       *
0018  *   Free Software Foundation, Inc.,                                     *
0019  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.           *
0020  *************************************************************************/
0021 #ifndef JUMPBACKWARDNODE_H
0022 #define JUMPBACKWARDNODE_H
0023 
0024 #include "executionnode.h"
0025 #include "result/diceresult.h"
0026 /**
0027  * @brief The JumpBackwardNode class is dedicated to change the previous dice of one dice option.
0028  */
0029 class JumpBackwardNode : public ExecutionNode
0030 {
0031 public:
0032     /**
0033      * @brief JumpBackwardNode allows to get result from remote node in the execution tree.
0034      */
0035     JumpBackwardNode();
0036     /**
0037      * @brief run - performs the actions
0038      * @param previous
0039      */
0040     virtual void run(ExecutionNode* previous= nullptr);
0041 
0042     /**
0043      * @brief toString
0044      * @return
0045      */
0046     virtual QString toString(bool) const;
0047     /**
0048      * @brief getPriority
0049      * @return
0050      */
0051     virtual qint64 getPriority() const;
0052     /**
0053      * @brief generateDotTree
0054      * @param s
0055      */
0056     virtual void generateDotTree(QString& s);
0057     /**
0058      * @brief getCopy
0059      * @return
0060      */
0061     virtual ExecutionNode* getCopy() const;
0062 
0063 private:
0064     DiceResult* m_diceResult;
0065     ExecutionNode* m_backwardNode;
0066 };
0067 
0068 #endif // JUMPBACKWARDNODE_H