Class ToggleOrHold
A simple class for tracking on/off inputs in either toggle mode or hold down.
Also allows for simple reference counted blockers that can interrupt and toggle the output, though care must be taken to make sure each blocker is removed when appropriate.
For a safer but less optimal implementation that allows tracking of specific blockers, use the SafeToggleOrHold base class.
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: NeoFPS.dll
Syntax
[Serializable]
public class ToggleOrHold
Constructors
ToggleOrHold(Func<Boolean>)
Declaration
protected ToggleOrHold(Func<bool> isBlockedCallback)
Parameters
| Type |
Name |
Description |
| System.Func<System.Boolean> |
isBlockedCallback |
|
Properties
isBlocked
Declaration
public bool isBlocked { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
on
Declaration
public bool on { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
Methods
Hold(Boolean)
Declaration
public void Hold(bool hold = true)
Parameters
| Type |
Name |
Description |
| System.Boolean |
hold |
|
OnActivate()
Declaration
protected virtual void OnActivate()
OnDeactivate()
Declaration
protected virtual void OnDeactivate()
ReadProperties(INeoDeserializer, Int32)
Declaration
public void ReadProperties(INeoDeserializer reader, int hash)
Parameters
ReadProperties(INeoDeserializer, String)
Declaration
public void ReadProperties(INeoDeserializer reader, string key)
Parameters
Declaration
public void SetInput(bool toggle, bool hold)
Parameters
| Type |
Name |
Description |
| System.Boolean |
toggle |
|
| System.Boolean |
hold |
|
Toggle()
Declaration
WriteProperties(INeoSerializer, Int32, Boolean)
Declaration
public void WriteProperties(INeoSerializer writer, int hash, bool writeBlockers)
Parameters
| Type |
Name |
Description |
| INeoSerializer |
writer |
|
| System.Int32 |
hash |
|
| System.Boolean |
writeBlockers |
|
WriteProperties(INeoSerializer, String, Boolean)
Declaration
public void WriteProperties(INeoSerializer writer, string key, bool writeBlockers)
Parameters
| Type |
Name |
Description |
| INeoSerializer |
writer |
|
| System.String |
key |
|
| System.Boolean |
writeBlockers |
|