81 lines
1.2 KiB
C#
81 lines
1.2 KiB
C#
using System.Collections.Generic;
|
|
|
|
public static class TerrainSplat
|
|
{
|
|
public enum Enum
|
|
{
|
|
Dirt = 1,
|
|
Snow = 2,
|
|
Sand = 4,
|
|
Rock = 8,
|
|
Grass = 0x10,
|
|
Forest = 0x20,
|
|
Stones = 0x40,
|
|
Gravel = 0x80
|
|
}
|
|
|
|
public const int COUNT = 8;
|
|
|
|
public const int EVERYTHING = -1;
|
|
|
|
public const int NOTHING = 0;
|
|
|
|
public const int DIRT = 1;
|
|
|
|
public const int SNOW = 2;
|
|
|
|
public const int SAND = 4;
|
|
|
|
public const int ROCK = 8;
|
|
|
|
public const int GRASS = 16;
|
|
|
|
public const int FOREST = 32;
|
|
|
|
public const int STONES = 64;
|
|
|
|
public const int GRAVEL = 128;
|
|
|
|
public const int DIRT_IDX = 0;
|
|
|
|
public const int SNOW_IDX = 1;
|
|
|
|
public const int SAND_IDX = 2;
|
|
|
|
public const int ROCK_IDX = 3;
|
|
|
|
public const int GRASS_IDX = 4;
|
|
|
|
public const int FOREST_IDX = 5;
|
|
|
|
public const int STONES_IDX = 6;
|
|
|
|
public const int GRAVEL_IDX = 7;
|
|
|
|
private static Dictionary<int, int> type2index = new Dictionary<int, int>
|
|
{
|
|
{ 8, 3 },
|
|
{ 16, 4 },
|
|
{ 4, 2 },
|
|
{ 1, 0 },
|
|
{ 32, 5 },
|
|
{ 64, 6 },
|
|
{ 2, 1 },
|
|
{ 128, 7 }
|
|
};
|
|
|
|
public static Dictionary<int, int> GetType2IndexDic()
|
|
{
|
|
return new Dictionary<int, int>(type2index);
|
|
}
|
|
|
|
public static int TypeToIndex(int id)
|
|
{
|
|
return type2index[id];
|
|
}
|
|
|
|
public static int IndexToType(int idx)
|
|
{
|
|
return 1 << idx;
|
|
}
|
|
}
|