Class HistoryStack
Controller for handling stack manipulations in history and reverse buffers.
Inheritance
Namespace: FlaxEditor.History
Assembly: FlaxEngine.CSharp.dll
Syntax
public sealed class HistoryStack : Object
Constructors
HistoryStack(Int32)
Initializes a new instance of the HistoryStack class.
Declaration
public HistoryStack(int historyActionsLimit = 1000)
Parameters
System.Int32
historyActionsLimit
The history actions limit. |
Properties
HistoryActionsLimit
Gets the history actions limit.
Declaration
public int HistoryActionsLimit { get; set; }
Property Value
System.Int32
The history actions limit. |
HistoryCount
Gets the history count.
Declaration
public int HistoryCount { get; }
Property Value
System.Int32
The history count. |
ReverseCount
Gets the reverse count.
Declaration
public int ReverseCount { get; }
Property Value
System.Int32
The reverse count. |
Methods
Clear()
Clears whole history (back and front).
Declaration
public void Clear()
PeekHistory()
Gets top-most item in history stack
Declaration
public IHistoryAction PeekHistory()
Returns
IHistoryAction
Found element or null |
PeekReverse()
Gets top-most item in reverse stack
Declaration
public IHistoryAction PeekReverse()
Returns
IHistoryAction
Found element or null |
PopHistory()
Gets top-most item in history stack, and removes it from history stack. Adds forgot element in reverse stack.
Declaration
public IHistoryAction PopHistory()
Returns
IHistoryAction
Found element or null |
PopReverse()
Gets top-most item in reverse stack, and removes it from reverse stack. Adds forgot element in history stack.
Declaration
public IHistoryAction PopReverse()
Returns
IHistoryAction
Found element or null |
Push(IHistoryAction)
Adds new history element at top of history stack, and drops reverse stack
Declaration
public void Push(IHistoryAction item)
Parameters
IHistoryAction
item
Item to add |
TravelBack(Int32)
Gets element at given index from top of history stack, and adds all skipped elements to reverse stack
Declaration
public IHistoryAction TravelBack(int skipElements)
Parameters
System.Int32
skipElements
Amount of elements to skip from history stack |
Returns
IHistoryAction
|
Remarks
If skipElements is bigger, then amount of elements in history, returns null, clears history and pushes all to reverse stack
TravelReverse(Int32)
Gets element at given index from top of reverse stack, and adds all skipped elements to history stack
Declaration
public IHistoryAction TravelReverse(int skipElements)
Parameters
System.Int32
skipElements
Amount of elements to skip from reverse stack |
Returns
IHistoryAction
|
Remarks
If skipElements is bigger, then amount of elements in reverse, returns null, clears reverse and pushes all to history stack