2016-10-17 00:13:46 +02:00
|
|
|
/*****************************************************************************
|
2018-06-15 14:07:34 +02:00
|
|
|
* Copyright (c) 2014-2018 OpenRCT2 developers
|
2016-10-17 00:13:46 +02:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* For a complete list of all authors, please refer to contributors.md
|
|
|
|
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
2016-10-17 00:13:46 +02:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
2016-10-17 00:13:46 +02:00
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2016-12-28 14:16:15 +01:00
|
|
|
#include <openrct2/common.h>
|
2016-10-17 00:13:46 +02:00
|
|
|
|
2018-06-22 22:29:03 +02:00
|
|
|
struct SupportCall
|
|
|
|
{
|
2018-06-20 17:28:51 +02:00
|
|
|
int32_t height;
|
|
|
|
int16_t slope;
|
2016-10-17 00:13:46 +02:00
|
|
|
|
2018-06-22 22:29:03 +02:00
|
|
|
friend bool operator==(const SupportCall& lhs, const SupportCall& rhs)
|
|
|
|
{
|
|
|
|
if (lhs.height != rhs.height)
|
|
|
|
return false;
|
|
|
|
if (lhs.slope != rhs.slope)
|
|
|
|
return false;
|
2016-10-17 00:13:46 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-06-22 22:29:03 +02:00
|
|
|
bool operator!=(const SupportCall& other) const
|
|
|
|
{
|
2016-10-17 00:13:46 +02:00
|
|
|
return !(*this == other);
|
|
|
|
}
|
|
|
|
|
2018-06-22 22:29:03 +02:00
|
|
|
bool operator<(const SupportCall& other) const
|
|
|
|
{
|
|
|
|
if (height != other.height)
|
|
|
|
{
|
2016-10-17 00:13:46 +02:00
|
|
|
return height < other.height;
|
|
|
|
}
|
|
|
|
|
|
|
|
return slope < other.slope;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-06-22 22:29:03 +02:00
|
|
|
namespace GeneralSupportHeightCall
|
|
|
|
{
|
2016-10-17 15:15:40 +02:00
|
|
|
bool CallsMatch(SupportCall tileSupportCalls[4]);
|
2016-10-17 00:13:46 +02:00
|
|
|
|
2018-06-22 22:29:03 +02:00
|
|
|
bool FindMostCommonSupportCall(SupportCall calls[4], SupportCall* out);
|
2016-10-17 00:13:46 +02:00
|
|
|
|
2018-06-22 22:29:03 +02:00
|
|
|
bool AssertEquals(const SupportCall* lhs, const SupportCall* rhs);
|
|
|
|
}; // namespace GeneralSupportHeightCall
|