a lottt of stuff

This commit is contained in:
Milxnor
2023-03-05 01:03:51 -05:00
parent 039731eb68
commit 3e2da1eedf
44 changed files with 2086 additions and 1165 deletions

45
Project Reboot 3.0/Set.h Normal file
View 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;
};