Class DirtyFlag
Handles tracking a dirty state, and now allowing to 'SetDirty' while its in the process of being updated. This way, if a dirty flag tries to set while its doing the dirty processing, it will make it dirty even after dirty processing complete.
Inheritance
System.Object
DirtyFlag
Namespace: Eco.Core.Utils
Assembly: Eco.Core.dll
Syntax
public sealed class DirtyFlag : ValueType
Methods
ClearFlag()
Clear without processing.
Declaration
public void ClearFlag()
FinishUpdate()
Finishes update started with TryStartUpdate(). Clears the flag if it wasn't SetDirty() during the update.
Declaration
public void FinishUpdate()
IfDirty(Action)
If dirty, execute the action, then clear the dirty flag.
Declaration
public void IfDirty(Action action)
Parameters
Type | Name | Description |
---|---|---|
System.Action | action |
SetDirty()
Set the flag dirty, taking care of multithreading where the dirty processing may be happening concurrently.
Declaration
public void SetDirty()
TryStartUpdate()
Tries to start update for DirtyFlag. Returns false
if flag isn't set and update not needed.
Declaration
public bool TryStartUpdate()
Returns
Type | Description |
---|---|
System.Boolean |
Operators
Implicit(DirtyFlag to Boolean)
Declaration
public static implicit operator bool (DirtyFlag flag)
Parameters
Type | Name | Description |
---|---|---|
DirtyFlag | flag |
Returns
Type | Description |
---|---|
System.Boolean |