Updates for IStateStack (#120)

This commit is contained in:
Jason Mitchell authored and GitHub committed 2025-03-11 15:19:26 -05:00
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;
}
}