OpenRCT2/test/testpaint/SegmentSupportHeightCall.hpp

46 lines
1.4 KiB
C++
Raw Normal View History

2016-10-17 00:13:46 +02:00
/*****************************************************************************
* Copyright (c) 2014-2018 OpenRCT2 developers
2016-10-17 00:13:46 +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
*
* 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>
2018-02-01 12:28:50 +01:00
#include <openrct2/paint/Paint.h>
2018-06-22 22:29:03 +02:00
#include <vector>
2016-10-17 00:13:46 +02:00
struct SegmentSupportCall
{
uint16_t segments;
int32_t height;
int16_t slope;
2018-06-22 22:29:03 +02:00
bool operator<(const SegmentSupportCall& other) const
{
if (height != other.height)
{
return height < other.height;
}
2018-06-22 22:29:03 +02:00
if (segments != other.segments)
{
return segments < other.segments;
}
return slope < other.slope;
}
2016-10-17 00:13:46 +02:00
};
2018-06-22 22:29:03 +02:00
class SegmentSupportHeightCall
{
2016-10-17 00:13:46 +02:00
public:
static std::vector<SegmentSupportCall> getSegmentCalls(support_height supports[9], uint8_t rotation);
2016-10-17 00:13:46 +02:00
static bool CallsMatch(std::vector<SegmentSupportCall> tileSegmentSupportCalls[4]);
static bool CallsEqual(std::vector<SegmentSupportCall> lhs, std::vector<SegmentSupportCall> rhs);
2018-06-22 22:29:03 +02:00
static bool FindMostCommonSupportCall(std::vector<SegmentSupportCall> calls[4], std::vector<SegmentSupportCall>* out);
2016-10-17 00:13:46 +02:00
};