How to store and access blockdata?

Hi,

I think this is a rather simple question, but I think I don’t have a good solution for it.
It’s not about saving or loading a level, it’s about getting specific attributes of a block.

So I have a 2d byte Array storing my terrain Data. (2d top down game)
Now I have something like this to store the id:

terrainMap[x,y] = BlockDescription.GetBlock("Dirt").GetId();

I would assume that this is rather slow, because it has to go trough all Blocks and compare the names.
When I’m building my mesh it depends very much on the attributes so I need them very often in the least time possible.

I hope you understand my problem and maybe can help me out here.
I apreciate every help I can get!

You could just use an int as a code for the terrain type, like 0=no block at all, 1 = stone, 2 = earth and so on. That would help speed things up.

chunk[0,0] = 1; //sets the chunk at coordinates 1,1 to stone
Getting the data:
blockdata = chunk [1,1];