9 lines
387 B
Kotlin
9 lines
387 B
Kotlin
package filesystem
|
|
|
|
// Note sealed allows for simpler logic in FSCreator by guaranteeing FSFile and FSFolder are the only possible FSEntries
|
|
// (as we expect), and it also makes the class abstract as required.
|
|
sealed class FSEntry(val name: String)
|
|
|
|
class FSFile(name: String, val content: String) : FSEntry(name)
|
|
|
|
class FSFolder(name: String, val entries: List<FSEntry>) : FSEntry(name) |