mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-13 15:16:07 +09:00
rudimentary framerate benchmarking (turning it on will make the game run significantly slower)
This commit is contained in:
@@ -80,6 +80,9 @@ class CircularArray<T>(val size: Int, val overwriteOnOverflow: Boolean): Iterabl
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To just casually add items to the list, use [appendHead], **please!**
|
||||
*/
|
||||
fun appendTail(item: T) {
|
||||
// even if overflowing is enabled, appending at tail causes head element to be altered, therefore such action
|
||||
// must be blocked by throwing overflow error
|
||||
@@ -183,6 +186,12 @@ class CircularArray<T>(val size: Int, val overwriteOnOverflow: Boolean): Iterabl
|
||||
return accumulator
|
||||
}
|
||||
|
||||
fun toList(): List<T> {
|
||||
val list = ArrayList<T>()
|
||||
iterator().forEach { list.add(it) }
|
||||
return list.toList()
|
||||
}
|
||||
|
||||
private inline fun Int.wrap() = this fmod size
|
||||
|
||||
override fun toString(): String {
|
||||
|
||||
Reference in New Issue
Block a user