mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
a lottt of stuff
This commit is contained in:
45
Project Reboot 3.0/Set.h
Normal file
45
Project Reboot 3.0/Set.h
Normal file
@@ -0,0 +1,45 @@
|
||||
#pragma once
|
||||
|
||||
#include "SparseArray.h"
|
||||
|
||||
template <typename ElementType>
|
||||
class TSetElement
|
||||
{
|
||||
public:
|
||||
ElementType Value;
|
||||
mutable int32 HashNextId;
|
||||
mutable int32 HashIndex;
|
||||
|
||||
TSetElement(ElementType InValue, int32 InHashNextId, int32 InHashIndex)
|
||||
: Value(InValue)
|
||||
, HashNextId(InHashNextId)
|
||||
, HashIndex(InHashIndex)
|
||||
{
|
||||
}
|
||||
|
||||
FORCEINLINE TSetElement<ElementType>& operator=(const TSetElement<ElementType>& Other)
|
||||
{
|
||||
Value = Other.Value;
|
||||
}
|
||||
|
||||
FORCEINLINE bool operator==(const TSetElement& Other) const
|
||||
{
|
||||
return Value == Other.Value;
|
||||
}
|
||||
FORCEINLINE bool operator!=(const TSetElement& Other) const
|
||||
{
|
||||
return Value != Other.Value;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename InElementType> //, typename KeyFuncs, typename Allocator>
|
||||
class TSet
|
||||
{
|
||||
typedef TSetElement<InElementType> ElementType;
|
||||
typedef TSparseArrayElementOrListLink<ElementType> ArrayElementType;
|
||||
|
||||
TSparseArray<ElementType> Elements;
|
||||
|
||||
mutable TInlineAllocator<1>::ForElementType<int> Hash;
|
||||
mutable int32 HashSize;
|
||||
};
|
||||
Reference in New Issue
Block a user