Class State
The base class which handles in-context states.
Inherited Members
Namespace: Exiled.API.Features.Core.StateMachine
Assembly: Exiled.API.dll
Syntax
public abstract class State : EActor, IEntity, IWorldSpace, IPosition, IRotation, IState
Properties
| Improve this Doc View SourceActiveControllers
Gets all the StateControllers running on this State.
Declaration
public IEnumerable<StateController> ActiveControllers { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<StateController> |
Controllers
Gets all the StateControllers listening to this State.
Declaration
public IEnumerable<StateController> Controllers { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<StateController> |
Description
Declaration
public virtual string Description { get; }
Property Value
Type | Description |
---|---|
System.String |
Id
Declaration
public abstract byte Id { get; }
Property Value
Type | Description |
---|---|
System.Byte |
InactiveControllers
Gets all the StateControllers running on a State other than this.
Declaration
public IEnumerable<StateController> InactiveControllers { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<StateController> |
List
Gets all registered states.
Declaration
public static IEnumerable<State> List { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<State> |
Name
Declaration
public virtual string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceGet(Byte)
Gets the State belonging to the specified id.
Declaration
public static State Get(byte id)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | id | The state's id. |
Returns
Type | Description |
---|---|
State | The corresponding State, or null if not found. |
Get(Byte, Byte)
Gets the States belonging to the specified id between the defined range.
Declaration
public static IEnumerable<State> Get(byte minRange, byte maxRange)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | minRange | The minimum inclusive range. |
System.Byte | maxRange | The maximum exclusive range. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<State> | All States belonging to the specified id between the specified range. |
Get(Byte[])
Gets the States belonging to the specified id between the defined ids.
Declaration
public static IEnumerable<State> Get(params byte[] ids)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | ids | The ids to look for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<State> | All States belonging to the specified id between the defined ids. |
Get(String)
Gets the State belonging to the specified name.
Declaration
public static State Get(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The state's name. |
Returns
Type | Description |
---|---|
State | The corresponding State, or null if not found. |
Get(String[])
Gets the States belonging to the specified id between the defined names.
Declaration
public static IEnumerable<State> Get(params string[] names)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | names | The names to look for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<State> | All States belonging to the specified id between the defined names. |
Get(Type)
Gets the State belonging to the specified System.Type.
Declaration
public static State Get(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The state's System.Type. |
Returns
Type | Description |
---|---|
State | The corresponding State, or null if not found. |
Get(Type[])
Gets the States belonging to the specified id between the defined types.
Declaration
public static IEnumerable<State> Get(params Type[] types)
Parameters
Type | Name | Description |
---|---|---|
System.Type[] | types | The types to look for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<State> | All States belonging to the specified id between the defined types. |
Get<T>()
Gets the State belonging to the specified type T
.
Declaration
public static T Get<T>()
where T : State
Returns
Type | Description |
---|---|
T | The corresponding State, or null if not found. |
Type Parameters
Name | Description |
---|---|
T | The type to look for. |
InitializeStates(Boolean)
Initializes all states defined in the executing System.Reflection.Assembly.
Declaration
public static void InitializeStates(bool useAttribute = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | useAttribute | A value indicating whether attribute should be used. |
OnEnter(StateController)
Declaration
public virtual void OnEnter(StateController stateController)
Parameters
Type | Name | Description |
---|---|---|
StateController | stateController |
OnExit(StateController)
Declaration
public virtual void OnExit(StateController stateController)
Parameters
Type | Name | Description |
---|---|---|
StateController | stateController |
Tick()
Declaration
protected override void Tick()
Overrides
| Improve this Doc View SourceToString()
Converts the State to a human readable System.String representation.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A human readable System.String representation of the State object. |
Overrides
TryGet(Byte, out State)
Tries to get a State given the specified id.
Declaration
public static bool TryGet(byte id, out State state)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | id | The state's id. |
State | state | The corresponding State, or null if not found. |
Returns
Type | Description |
---|---|
System.Boolean | true if a State was found; otherwise, false. |
TryGet(String, out State)
Tries to get a State given the specified name.
Declaration
public static bool TryGet(string name, out State state)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The state's name. |
State | state | The corresponding State, or null if not found. |
Returns
Type | Description |
---|---|
System.Boolean | true if a State was found; otherwise, false. |
TryGet(Type, out State)
Tries to get a State given the specified System.Type.
Declaration
public static bool TryGet(Type type, out State state)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The state's System.Type. |
State | state | The corresponding State, or null if not found. |
Returns
Type | Description |
---|---|
System.Boolean | true if a State was found; otherwise, false. |
TryGet<T>(out T)
Tries to get a State given the specified System.Type.
Declaration
public bool TryGet<T>(out T state)
where T : State
Parameters
Type | Name | Description |
---|---|---|
T | state | The corresponding State, or null if not found. |
Returns
Type | Description |
---|---|
System.Boolean | true if a State was found; otherwise, false. |
Type Parameters
Name | Description |
---|---|
T | The type to look for. |