StaticLazyStack<T> Class

Summary

A static stack that creates new elements as needed but keeps and reuses them instead of actually adding and removing like a regular stack.
Assembly
Kybernetik.InspectorGadgets.Editor.dll
Namespace
InspectorGadgets
Base Types
  • Object
Derived Types
graph BT Type-->Base0["Object"] Type["StaticLazyStack<T>"] class Type type-node Derived0["DisposableStaticLazyStack<T>"]-->Type click Derived0 "/inspector-gadgets/api/InspectorGadgets/DisposableStaticLazyStack_1"

Syntax

public abstract class StaticLazyStack<T> where T : StaticLazyStack<T>, new()

Type Parameters

Name Description
T

Fields

Name Constant Value Summary
Stack
The elements managed by this class.

Note that the number of active elements is stored in InspectorGadgets.StaticLazyStack`1.StackHeight rather than the count of this list.
static

Properties

Name Value Summary
MaxHeight int
The maximum number of elements that can be in the stack at a time. Default = 10.
static
StackHeight int
The number of elements currently active in the stack.
static

Methods

Name Value Summary
Decrement() void
Decreases the InspectorGadgets.StaticLazyStack`1.StackHeight by 1.
static
GetCurrent() T
Gets the element currently at the top of the stack.
static
Increment() T
Increases the InspectorGadgets.StaticLazyStack`1.StackHeight by 1, ensures that an element exists at the last index and returns it.
static
OnIncrement() void
Called by InspectorGadgets.StaticLazyStack`1.Increment.