(cherry picked from commit 8a4a99b7e8)
This commit is contained in:
committed by
Jonathan G Rennison
parent
f9321686a7
commit
a7c2f489f6
@@ -25,14 +25,12 @@ constexpr uint32_t MAX_NUMBER_OF_NODES = 65536;
|
||||
struct CYapfRegionPatchNodeKey {
|
||||
WaterRegionPatchDesc m_water_region_patch;
|
||||
|
||||
static_assert(sizeof(TWaterRegionPatchLabel) == sizeof(byte)); // Important for the hash calculation.
|
||||
|
||||
inline void Set(const WaterRegionPatchDesc &water_region_patch)
|
||||
{
|
||||
m_water_region_patch = water_region_patch;
|
||||
}
|
||||
|
||||
inline int CalcHash() const { return m_water_region_patch.label | GetWaterRegionIndex(m_water_region_patch) << 8; }
|
||||
inline uint32_t CalcHash() const { return CalculateWaterRegionPatchHash(m_water_region_patch); }
|
||||
inline bool operator==(const CYapfRegionPatchNodeKey &other) const { return CalcHash() == other.CalcHash(); }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user