00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef HxNgbCnum_h
00011 #define HxNgbCnum_h
00012
00013 struct HxCoord
00014 {
00015 int x, y, z;
00016 };
00017
00018 class HxCnum
00019 {
00020 public:
00021 HxCnum();
00022 HxCnum(HxCoord* coords);
00023 HxCnum(const HxCnum& rhs);
00024 HxCnum& operator=(const HxCnum& rhs);
00025 HxCnum& operator=(HxCoord* coords);
00026 int x();
00027 int y();
00028 int z();
00029 void inc();
00030 bool operator!=(const HxCnum& rhs);
00031
00032 private:
00033 HxCoord* _coords;
00034 };
00035
00036 inline
00037 HxCnum::HxCnum()
00038 : _coords(0)
00039 {
00040 }
00041
00042 inline
00043 HxCnum::HxCnum(HxCoord* coords)
00044 : _coords(coords)
00045 {
00046 }
00047
00048 inline
00049 HxCnum::HxCnum(const HxCnum& rhs)
00050 : _coords(rhs._coords)
00051 {
00052 }
00053
00054 inline HxCnum&
00055 HxCnum::operator=(const HxCnum& rhs)
00056 {
00057 _coords = rhs._coords;
00058 return *this;
00059 }
00060
00061 inline HxCnum&
00062 HxCnum::operator=(HxCoord* coords)
00063 {
00064 _coords = coords;
00065 return *this;
00066 }
00067
00068 inline int
00069 HxCnum::x()
00070 {
00071 return _coords->x;
00072 }
00073
00074 inline int
00075 HxCnum::y()
00076 {
00077 return _coords->y;
00078 }
00079
00080 inline int
00081 HxCnum::z()
00082 {
00083 return _coords->y;
00084 }
00085
00086 inline void
00087 HxCnum::inc()
00088 {
00089 _coords++;
00090 }
00091
00092 inline bool
00093 HxCnum::operator!=(const HxCnum& rhs)
00094 {
00095 return _coords != rhs._coords;
00096 }
00097
00098 #endif