Hi,
So basically i am following this quill18 Tutorial.(
).
I got a class TileType containing Data about different tiles (name, moveCost, etc.).
I got a map class which handles the generell logic.
In the map class i have the following variables:
[…]
public TileType[ ] tileTypes;
int[,] tiles;
[…]
So the int array gets initalized with different numbers 0-2 and then each number will later be used to instantiate the correct TileType a 0 would be the first TileType in the TileTypes list…
Now in the Video (25 seconds in) he said for his own code he would probably use enums for the TileTypes.
My problem now is that i just cant wrap my head arround on how to use enums in that case.
If i use an enum lets say TileVariants {Land,Water,…} then i would have to make an TileVaraints Array tiles instead of int right? But how do i then get the connection to the TileTypes where the specific data is. before i could just use the integer to get the right position of the TileType list with an enum i would have to check the full list and compare for a TileVariants reference inside the TileType class or something.
Or does it stay an int Array and you change the TileType List or something. But then whats the point of using enums because you still have to remember which number represents which tile.
Idk for some reason thats driving me crazy that i just cant think about how to use an enum there.