00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef FIFE_PATHFINDER_SEARCHSPACE
00023 #define FIFE_PATHFINDER_SEARCHSPACE
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include "model/structures/location.h"
00034
00035 namespace FIFE {
00036
00037 class Layer;
00038
00039 class SearchSpace {
00040 public:
00041 SearchSpace(Layer* layer);
00042
00043 int getUpperX() const {
00044 return m_upperX;
00045 }
00046
00047 int getUpperY() const {
00048 return m_upperY;
00049 }
00050
00051 int getLowerX() const {
00052 return m_lowerX;
00053 }
00054
00055 int getLowerY() const {
00056 return m_lowerY;
00057 }
00058
00059 int getWidth() const {
00060
00061 return (m_upperX - m_lowerX) + 1;
00062 }
00063
00064 int getHeight() const {
00065 return (m_upperY - m_lowerY) + 1;
00066 }
00067
00068 Layer* getLayer() const {
00069 return m_layer;
00070 }
00071
00080 bool isInSearchSpace(const Location& location) const;
00081
00090 ModelCoordinate translateCoordsToSearchSpace(const ModelCoordinate& coords) const;
00091
00099 int convertCoordToInt(const ModelCoordinate& coord) const;
00100
00109 ModelCoordinate convertIntToCoord(const int cell) const;
00110
00115 int getMaxIndex() const;
00116 private:
00117
00118 int m_upperX;
00119 int m_upperY;
00120 int m_lowerX;
00121 int m_lowerY;
00122
00123
00124 Layer* m_layer;
00125 };
00126
00127 }
00128
00129
00130 #endif