RollingClickArray

class RollingClickArray(cycleLength: Int, val iterations: Int)

A circular buffer that maintains double the cycle length and regenerates the second half when reaching the midpoint

Constructors

Link copied to clipboard
constructor(cycleLength: Int, iterations: Int)

Properties

Link copied to clipboard
var head: Int
Link copied to clipboard

Functions

Link copied to clipboard
fun advance(amount: Int = 1): Boolean

Advances the head position and returns true if halfway point reached

Link copied to clipboard
fun clear()

Clears the array

Link copied to clipboard
fun get(relativeIndex: Int): Int

Gets value at relative index from current head

Link copied to clipboard
fun push(cycleArray: IntArray)
Link copied to clipboard
fun set(relativeIndex: Int, value: Int)

Sets value at relative index from current head