mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2025-01-30 20:34:27 +01:00
Coord: remove useless code
This commit is contained in:
parent
3fc1b51f6b
commit
05605a63ae
2 changed files with 7 additions and 31 deletions
|
@ -49,14 +49,6 @@ bool Coord::isValid() const
|
|||
m_col >= BOARD_MIN && m_col <= BOARD_MAX);
|
||||
}
|
||||
|
||||
/*
|
||||
void Coord::operator=(const Coord &iOther)
|
||||
{
|
||||
m_dir = iOther.m_dir;
|
||||
m_row = iOther.m_row;
|
||||
m_col = iOther.m_col;
|
||||
}
|
||||
*/
|
||||
|
||||
bool Coord::operator==(const Coord &iOther) const
|
||||
{
|
||||
|
@ -67,6 +59,7 @@ bool Coord::operator==(const Coord &iOther) const
|
|||
&& m_dir == iOther.m_dir;
|
||||
}
|
||||
|
||||
|
||||
void Coord::swap()
|
||||
{
|
||||
int tmp = m_col;
|
||||
|
@ -105,7 +98,7 @@ void Coord::setFromString(const wstring &iWStr)
|
|||
setCol(-1);
|
||||
}
|
||||
|
||||
wstring Coord::toString(coord_mode_t mode) const
|
||||
wstring Coord::toString() const
|
||||
{
|
||||
ASSERT(isValid(), "Invalid coordinates");
|
||||
|
||||
|
@ -116,22 +109,10 @@ wstring Coord::toString(coord_mode_t mode) const
|
|||
_swprintf(scol, 3, L"%d", m_col);
|
||||
_swprintf(srow, 3, L"%c", m_row + 'A' - 1);
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case COORD_MODE_COMPACT:
|
||||
if (getDir() == HORIZONTAL)
|
||||
_swprintf(res, 7, L"%ls%ls", srow, scol);
|
||||
else
|
||||
_swprintf(res, 7, L"%ls%ls", scol, srow);
|
||||
break;
|
||||
case COORD_MODE_LONG:
|
||||
if (getDir() == HORIZONTAL)
|
||||
_swprintf(res, 7, L"%2ls %2ls", srow, scol);
|
||||
else
|
||||
_swprintf(res, 7, L"%2ls %2ls", scol, srow);
|
||||
break;
|
||||
}
|
||||
|
||||
if (getDir() == HORIZONTAL)
|
||||
_swprintf(res, 7, L"%ls%ls", srow, scol);
|
||||
else
|
||||
_swprintf(res, 7, L"%ls%ls", scol, srow);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -59,13 +59,8 @@ public:
|
|||
void swap();
|
||||
|
||||
|
||||
enum coord_mode_t
|
||||
{
|
||||
COORD_MODE_COMPACT,
|
||||
COORD_MODE_LONG
|
||||
};
|
||||
void setFromString(const wstring &iStr);
|
||||
wstring toString(coord_mode_t mode = COORD_MODE_COMPACT) const;
|
||||
wstring toString() const;
|
||||
|
||||
private:
|
||||
Direction m_dir;
|
||||
|
|
Loading…
Add table
Reference in a new issue