Create a data structure to contain the types:
class BlockDescriptor
{
public Tile Tile { get; }
public int Hardness { get;}
public string DisplayName { get; }
public bool HasGravity { get; }
public BlockDescriptor(Tile tile, int hardness, string name, bool gravity)
{
Tile = tile;
Hardness = hardness;
DisplayName = name;
HasGravity = gravity;
}
}
Then you can store them in a dictionary:
Dictionary<int, BlockDescriptor> blockProperties = new Dictionary<int, BlockDescriptor>();
blockProperties.Add(0, new BlockDescriptor(/* Tile */, 1, "Block A", false);
blockProperties.Add(1, new BlockDescriptor(/* Tile */, 2, "Block B", true);
Alternatively you could use a tuple:
var blockProperties = new Dictionary<int, (Tile, int, string, bool)>();
blockProperties.Add(0, (/* Tile */, 0, "Block A", false));
blockProperties.Add(1, (/* Tile */, 1, "Block B", true));
I recommend choosing a data structure, because you can implement various interfaces such as IEquatable, IEqualityComparer, to affect the behavior within LINQ queries, containers, etc. Additionally, it provides potential for various introspection properties (e.g. IsUnbreakable, HasTileWithTransparency), or methods (e.g. CalculateHardness)
Tuple<T1, T2, T3>
– ESG