Class IntDataMap2D
- Namespace
- Vintagestory.API.Datastructures
- Assembly
- VintagestoryAPI.dll
A datastructure to hold 2 dimensional data in the form of ints. Can be used to perfrom bilinear interpolation between individual values
[ProtoContract]
public class IntDataMap2D
- Inheritance
-
IntDataMap2D
- Inherited Members
- Extension Methods
Fields
BottomRightPadding
Bottom and Right padding
[ProtoMember(4)]
public int BottomRightPadding
Field Value
Data
[ProtoMember(1, IsPacked = true)]
public int[] Data
Field Value
- int[]
Size
Full Width and Length of the map (square)
[ProtoMember(2)]
public int Size
Field Value
TopLeftPadding
Top and Left padding
[ProtoMember(3)]
public int TopLeftPadding
Field Value
Properties
InnerSize
Width and Length of the map excluding any padding
public int InnerSize { get; }
Property Value
Methods
CreateEmpty()
public static IntDataMap2D CreateEmpty()
Returns
GetColorLerpedCorrectly(float, float)
public int GetColorLerpedCorrectly(float x, float z)
Parameters
Returns
GetInt(int, int)
public int GetInt(int x, int z)
Parameters
Returns
GetIntLerpedCorrectly(float, float)
public float GetIntLerpedCorrectly(float x, float z)
Parameters
Returns
GetUnpaddedColorLerped(float, float)
public int GetUnpaddedColorLerped(float x, float z)
Parameters
Returns
GetUnpaddedColorLerpedForNormalizedPos(float, float)
The parameters should both be in the range 0..1. They represent the position within the MapRegion. Calling code may need to use the (float)((double)val % 1.0) technique to ensure enough bits of precision when taking the fractional part (% 1.0), if val is large (for example a BlockPos in a 8Mx8M world)
public int GetUnpaddedColorLerpedForNormalizedPos(float x, float z)
Parameters
Returns
GetUnpaddedInt(int, int)
public int GetUnpaddedInt(int x, int z)
Parameters
Returns
GetUnpaddedIntLerped(float, float)
public float GetUnpaddedIntLerped(float x, float z)
Parameters
Returns
GetUnpaddedIntLerpedForBlockPos(int, int, int)
public int GetUnpaddedIntLerpedForBlockPos(int x, int z, int regionSize)
Parameters
Returns
SetInt(int, int, int)
public void SetInt(int x, int z, int value)