Combo breaker!Bad joke. Really, what you should do is something
close to a combination of the two. If you know that there will be some set of values that will
always be the same for a given tile type, regardless of location, etc. You store that data in a singleton-holding data structure. Or, I mean you could use an enum, which for semi-small numbers of types works like a charm and pretty much removes the need for you to do that. Hah.
Then, you pass that enum object to the Tile on creation, so that it has access to the TileType which stores all of its general data, without having to make a copy of it.
1 2 3 4
| public enum TileType { GRASS, DIRT, ETC; } |
1 2 3 4 5 6 7
| public class Tile { private TileType type; public Tile(TileType type, ... ) { this.type = type; } } |
If you don't think an Enum will cut it, try making a Factory of some sort instead.
Pass reference, not id. (Looking up this data could be costly, or not, but let your language do the work for you there.)