mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-16 00:26:07 +09:00
FIX: quickbar opacity bug, Notification won't display, remaned majuscule to fullwidth, keyboard layouts for control helper
Former-commit-id: 99c51499131a7cbae1b7345c15d804bd5340e7b6 Former-commit-id: 1326b69cb920d3590fe2cbe33013c85c9eeb1191
This commit is contained in:
@@ -5,18 +5,19 @@ import java.util.function.Consumer
|
||||
|
||||
/**
|
||||
* Simple ArrayList wrapper that acts as history keeper. You can append any data but cannot delete.
|
||||
*
|
||||
* Created by minjaesong on 16-07-13.
|
||||
*/
|
||||
class HistoryArray<T>(val historyMax: Int) {
|
||||
|
||||
val history = ArrayList<T?>(Math.min(historyMax, 256)) // 256: arbitrary-set upper bound
|
||||
val history = ArrayList<T?>(Math.min(historyMax, 256)) // 256: arbitrary set upper bound
|
||||
|
||||
fun add(value: T) {
|
||||
if (history.size == 0) {
|
||||
history.add(value)
|
||||
return
|
||||
}
|
||||
// push existing values to back 1 index
|
||||
// push existing values to an index
|
||||
else {
|
||||
for (i in history.size - 1 downTo 0) {
|
||||
// if history.size is smaller than historyMax, make room by appending
|
||||
|
||||
Reference in New Issue
Block a user