There are two ways to do this.
1. Use templates. https://tour.dlang.org/tour/en/basics/templates
2. Use a factory function. https://tour.dlang.org/tour/en/basics/delegates
```d
class Map(ATile : Tile) {
ATile[] tiles;
}
```
Or:
```d
class Map {
Tile[] tiles;
Tile delegate(string params) factory;
this() {
factory = (string params) {
return new Tile;
};
foreach(i; 0 .. 10) {
tiles ~= factory("");
}
}
}
```
The factory delegate is a very rough way to do it, there are other ways
to describe it including an overridable method.
The design pattern: https://en.wikipedia.org/wiki/Factory_method_pattern