00001 00008 /* 00009 This file is part of Teapot Colony Wars. 00010 00011 Teapot Colony Wars is free software: you can redistribute it and/or modify 00012 it under the terms of the GNU General Public License as published by 00013 the Free Software Foundation, either version 2 of the License, or 00014 (at your option) any later version. 00015 00016 Teapot Colony Wars is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 GNU General Public License for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with Teapot Colony Wars. If not, see <http://www.gnu.org/licenses/>. 00023 */ 00024 00025 #ifndef MOVE_H 00026 #define MOVE_H 00027 00028 #include <utility> //For pair 00029 00030 #include "MoveCommand.h" 00031 00032 class MoveIterator; 00033 00037 class Move 00038 { 00039 private: 00040 00041 friend class MoveIterator; 00042 00046 Move * _next; 00047 00048 protected: 00049 00055 Move(Move * next); 00056 00057 public: 00058 00062 virtual ~Move(); 00063 00069 virtual move_command getHandledMovement() const = 0; 00070 00076 virtual std::pair<int,int> getHandledRelCoords() const = 0; 00077 00083 virtual move_command getHandledOpposite() const = 0; 00084 00090 unsigned int size(); 00091 00097 MoveIterator begin(); 00098 00104 MoveIterator end(); 00105 00114 std::pair<int,int> getAbsCoords(move_command cmd, int i, int j) const; 00115 00123 std::pair<int,int> getAbsCoords(int i, int j) const; 00124 00131 move_command opposite(move_command cmd) const; 00132 }; 00133 00134 #endif // MOVE_H