Begonnen met implementatie wiimote. Nu even de wiiuse dll op de goede plaats zetten.
This commit is contained in:
@@ -2,30 +2,30 @@ package pm.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ArrayCycle<T> extends ArrayList<T> {
|
||||
public class ArrayCycle<E> extends ArrayList<E> {
|
||||
protected static final long serialVersionUID = 1L;
|
||||
|
||||
protected int index = 0;
|
||||
|
||||
public T current() {
|
||||
public E current() {
|
||||
return this.get(index);
|
||||
}
|
||||
|
||||
public T previous() {
|
||||
public E previous() {
|
||||
if (--index < 0) {
|
||||
index = Math.max(0, size() - 1);
|
||||
}
|
||||
return get(index);
|
||||
}
|
||||
|
||||
public T next() {
|
||||
public E next() {
|
||||
if (++index >= size()) {
|
||||
index = 0;
|
||||
}
|
||||
return get(index);
|
||||
}
|
||||
|
||||
public T reset() {
|
||||
public E reset() {
|
||||
return get(index = 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user