Kotlin, Kotlin Design Patterns, Kotlin Abstract Factory, Kotlin Factory.
additional creation logic. interface DungeonFactory { fun createWall(): Wall fun createFloor(): Floor } class CastleDungeonFactory : DungeonFactory { override fun createWall(): Wall = CastleWall() override fun createFloor(): Floor = CastleFloor() } class PyramidDungeonFactory : DungeonFactory {