![]() |
tModLoader v2024.07
A mod to make and play Terraria mods
|
Efficient builder for PosData<T>[] lookups covering the whole world. Must add elements in ascending pos order. More...
Public Member Functions | |
OrderedSparseLookupBuilder (int capacity=1048576, bool compressEqualValues=true, bool insertDefaultEntries=false) | |
Use compressEqualValues to produce a smaller lookup which won't work with PosData.LookupExact When using compressEqualValues without insertDefaultEntries , unspecified positions will default to the value of the previous specified position More... | |
void | Add (int pos, T value) |
void | Add (int x, int y, T value) |
PosData< T >[] | Build () |
Efficient builder for PosData<T>[] lookups covering the whole world. Must add elements in ascending pos order.
PosData< T >.OrderedSparseLookupBuilder.OrderedSparseLookupBuilder | ( | int | capacity = 1048576 , |
bool | compressEqualValues = true , |
||
bool | insertDefaultEntries = false |
||
) |
Use compressEqualValues to produce a smaller lookup which won't work with PosData.LookupExact When using compressEqualValues without insertDefaultEntries , unspecified positions will default to the value of the previous specified position
capacity | Defaults to 1M entries to reduce reallocations. Final built collection will be smaller. |
compressEqualValues | Reduces the size of the map, but gives unspecified positions a value. |
insertDefaultEntries | Ensures unspecified positions are assigned a default value when used with compressEqualValues |