Initial Commit
This commit is contained in:
93
common/COORD.HPP
Normal file
93
common/COORD.HPP
Normal file
@@ -0,0 +1,93 @@
|
||||
#ifndef _COMMON_COORD_HPP_
|
||||
#define _COMMON_COORD_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
|
||||
class Coord : private COORD
|
||||
{
|
||||
public:
|
||||
Coord(void);
|
||||
Coord(const Coord &someCoord);
|
||||
Coord(short x,short y);
|
||||
virtual ~Coord();
|
||||
Coord &operator=(const Coord &someCoord);
|
||||
WORD operator==(const Coord &someCoord)const;
|
||||
operator COORD&(void);
|
||||
short x(void)const;
|
||||
void x(short x);
|
||||
short y(void)const;
|
||||
void y(short y);
|
||||
private:
|
||||
};
|
||||
|
||||
inline
|
||||
Coord::Coord(void)
|
||||
{
|
||||
COORD::X=0;
|
||||
COORD::Y=0;
|
||||
}
|
||||
|
||||
inline
|
||||
Coord::Coord(const Coord &someCoord)
|
||||
{
|
||||
*this=someCoord;
|
||||
}
|
||||
|
||||
inline
|
||||
Coord::Coord(short x,short y)
|
||||
{
|
||||
COORD::X=x;
|
||||
COORD::Y=y;
|
||||
}
|
||||
|
||||
inline
|
||||
Coord::~Coord()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
Coord &Coord::operator=(const Coord &someCoord)
|
||||
{
|
||||
x(someCoord.x());
|
||||
y(someCoord.y());
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Coord::operator==(const Coord &someCoord)const
|
||||
{
|
||||
return (x()==someCoord.x()&&
|
||||
y()==someCoord.y());
|
||||
}
|
||||
|
||||
inline
|
||||
Coord::operator COORD&(void)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline
|
||||
short Coord::x(void)const
|
||||
{
|
||||
return COORD::X;
|
||||
}
|
||||
|
||||
inline
|
||||
void Coord::x(short x)
|
||||
{
|
||||
COORD::X=x;
|
||||
}
|
||||
|
||||
inline
|
||||
short Coord::y(void)const
|
||||
{
|
||||
return COORD::Y;
|
||||
}
|
||||
|
||||
inline
|
||||
void Coord::y(short y)
|
||||
{
|
||||
COORD::Y=y;
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user