寻路基本工具类定义 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

 

posted @ 2013-11-23 01:16  liusijian  阅读(329)  评论(0编辑  收藏  举报