1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-18 04:23:20 +01:00
Files
OpenRCT2/src/openrct2/interface/ZoomLevel.cpp
Hielke Morsink f0c1ea1d37 Split declarations and definitions to improve compile times when editing (#13332)
* Split FileStream declarations and definitions

* Split JobPool declarations and definitions

* Split StringBuilder declarations and definitions

* Split StringReader declarations and definitions

* Split ZoomLevel declarations and definitions

* Fix missing include in FileClassifier.cpp

* Remove pragma once from source files

* Fix missing include in StringBuilder.h

* Update Xcode project

* Fix compilation of tests

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2020-11-07 12:42:04 +00:00

102 lines
1.9 KiB
C++

/*****************************************************************************
* Copyright (c) 2020 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#include "ZoomLevel.h"
ZoomLevel::operator int8_t() const
{
return _level;
}
ZoomLevel ZoomLevel::operator++(int)
{
ZoomLevel tmp(*this);
operator++();
return tmp;
}
ZoomLevel& ZoomLevel::operator++()
{
_level++;
return *this;
}
ZoomLevel ZoomLevel::operator--(int)
{
ZoomLevel tmp(*this);
operator--();
return tmp;
}
ZoomLevel& ZoomLevel::operator--()
{
_level--;
return *this;
}
ZoomLevel& ZoomLevel::operator=(const ZoomLevel& other)
{
_level = other._level;
return *this;
}
ZoomLevel& ZoomLevel::operator+=(const ZoomLevel& rhs)
{
_level += rhs._level;
return *this;
}
ZoomLevel& ZoomLevel::operator-=(const ZoomLevel& rhs)
{
_level -= rhs._level;
return *this;
}
ZoomLevel operator+(ZoomLevel lhs, const ZoomLevel& rhs)
{
lhs += rhs;
return lhs;
}
ZoomLevel operator-(ZoomLevel lhs, const ZoomLevel& rhs)
{
lhs -= rhs;
return lhs;
}
bool operator==(const ZoomLevel& lhs, const ZoomLevel& rhs)
{
return lhs._level == rhs._level;
}
bool operator!=(const ZoomLevel& lhs, const ZoomLevel& rhs)
{
return lhs._level != rhs._level;
}
bool operator>=(const ZoomLevel& lhs, const ZoomLevel& rhs)
{
return lhs._level >= rhs._level;
}
bool operator<=(const ZoomLevel& lhs, const ZoomLevel& rhs)
{
return lhs._level <= rhs._level;
}
bool operator>(const ZoomLevel& lhs, const ZoomLevel& rhs)
{
return lhs._level > rhs._level;
}
bool operator<(const ZoomLevel& lhs, const ZoomLevel& rhs)
{
return lhs._level < rhs._level;
}