寻路基本工具类定义 Point.h
1 #ifndef __POINT__H 2 #define __POINT__H 3 4 template<typename T> 5 struct Point 6 { 7 Point():x(0),y(0){} 8 Point(const T _x, const T _y):x(_x),y(_y){} 9 inline void set(const int _x, const int _y){x = _x; y = _y;} 10 inline void set(const Point<T> &point){x = point.x; y = point.y;} 11 T x; 12 T y; 13 }; 14 15 typedef Point<int> PointI; 16 typedef Point<float> PointF; 17 18 #endif