mirror of
https://github.com/GTNewHorizons/GTNHLib.git
synced 2026-11-26 23:03:09 +00:00
Updates for IStateStack (#120)
This commit is contained in:
1 parent
1c66f22a4b
commit
1181fcedde
1 file changed
+27
@@ -2,10 +2,37 @@ package com.gtnewhorizon.gtnhlib.client.renderer.stacks;
|
||||
|
||||
public interface IStateStack<T> {
|
||||
|
||||
/**
|
||||
* Push the current state onto the stack.
|
||||
*
|
||||
* @return This state stack for chaining
|
||||
*/
|
||||
T push();
|
||||
|
||||
/**
|
||||
* Pop a state from the stack.
|
||||
*
|
||||
* @return This state stack for chaining
|
||||
*/
|
||||
T pop();
|
||||
|
||||
/**
|
||||
* Check if the stack is empty.
|
||||
*
|
||||
* @return true if the stack is empty
|
||||
*/
|
||||
boolean isEmpty();
|
||||
|
||||
/**
|
||||
* Clear the stack and reset to default state.
|
||||
*
|
||||
* @return This state stack for chaining
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
default T clear() {
|
||||
while (!isEmpty()) {
|
||||
pop();
|
||||
}
|
||||
return (T) this;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user