1 // Copyright (C) 2004 John Farrell
2 // Copyright (C) 2005, 2007 Ulf Lorenz
4 // This program 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.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Library General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
28 * This is needed by the AI so it can tell when a stack dies.
30 //! The result of a move by a stack.
37 //! set the result of any fight that happened
38 void setFightResult(Fight::Result d_fightResult);
40 //! set how many steps were taken in this move
41 void setStepCount(int stepCount) { d_stepCount = stepCount; }
43 int getStepCount() const {return d_stepCount;};
45 //! return the result of the fight, if there was one
46 Fight::Result getFightResult() const { return d_fightResult; }
48 //! did anything actually happen in this move?
49 bool didSomething() const { return (d_fight || (d_stepCount > 0) ); }
51 void setReachedEndOfPath(bool reached) {d_reached_end = reached;};
52 bool getReachedEndOfPath() const {return d_reached_end;}
54 void setOutOfMoves(bool out) {d_out_of_moves = out;}
55 bool getOutOfMoves() const {return d_out_of_moves;}
57 void setTreachery(bool treachery) {d_treachery = treachery;}
58 bool getTreachery() const {return d_treachery;}
60 void setConsideredTreachery(bool considered) {d_considered_treachery = considered;}
61 bool getConsideredTreachery() const {return d_considered_treachery;}
63 void setTooLargeStackInTheWay(bool s) {d_too_large_stack_in_the_way=s;}
64 bool getTooLargeStackInTheWay() const {return d_too_large_stack_in_the_way;}
66 void setMoveAborted(bool a) {d_move_aborted = a;}
67 bool getMoveAborted() const {return d_move_aborted;}
69 //! fill up d_out_of_moves, d_reached_end, and d_stepCount
70 void fillData(Stack *s, int stepCount);
79 bool d_considered_treachery;
80 //this is when we can't jump over a friendly stack.
81 bool d_too_large_stack_in_the_way;
82 Fight::Result d_fightResult;
86 #endif // MOVE_RESULT_H