Create action log panel in HUD
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package com.bartlomiejpluta.demo.util;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.LinkedList;
|
||||
|
||||
@AllArgsConstructor
|
||||
public class LimitedQueue<E> extends LinkedList<E> {
|
||||
private int limit;
|
||||
|
||||
@Override
|
||||
public boolean add(E o) {
|
||||
super.add(o);
|
||||
|
||||
while (size() > limit) {
|
||||
super.remove();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user