Open-source multiplayer game server compatible with the RuneScape client https://www.openrs2.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
openrs2/cache/src/main/kotlin/org/openrs2/cache/NamedEntryCollection.kt

25 lines
658 B

package org.openrs2.cache
import org.openrs2.util.krHashCode
/**
* A read-only view of a [MutableNamedEntryCollection].
*/
public interface NamedEntryCollection<out T : NamedEntry> : Iterable<T> {
public val size: Int
public val capacity: Int
public operator fun contains(id: Int): Boolean
public fun containsNamed(nameHash: Int): Boolean
public operator fun contains(name: String): Boolean {
return containsNamed(name.krHashCode())
}
public operator fun get(id: Int): T?
public fun getNamed(nameHash: Int): T?
public operator fun get(name: String): T? {
return getNamed(name.krHashCode())
}
}