/**
* A collection of [Storage] with a fixed capacity given by [storageIndices] size.
*/
interface StorageSystem {
/**
* Indices of the [Storage] containted in the system.
*/
val storageIndices: IntRange
/**
* Return a [Storage] instance.
*
* Should throw an [IllegalStateException] if [index] isn't contained in [storageIndices]
*/
operator fun get(index: Int): Storage
/**
* Replaces the storage at the specified [index] with the specified [storage].
*
* Should throw an [IllegalStateException] if [index] isn't contained in [storageIndices]
*/
operator fun set(index: Int, storage: Storage)
}
Replace
StorageCollection
withStorageSystem