Class State
- Namespace
- Exiled.API.Features.Core.StateMachine
- Assembly
- Exiled.API.dll
The base class which handles in-context states.
public abstract class State : EActor, IEntity, IWorldSpace, IPosition, IRotation, IState
- Inheritance
-
State
- Implements
- Inherited Members
- Extension Methods
Properties
ActiveControllers
Gets all the StateControllers running on this State.
public IEnumerable<StateController> ActiveControllers { get; }
Property Value
Controllers
Gets all the StateControllers listening to this State.
public IEnumerable<StateController> Controllers { get; }
Property Value
Description
Gets the state's description.
public virtual string Description { get; }
Property Value
Id
Gets the state's id.
public abstract byte Id { get; }
Property Value
InactiveControllers
Gets all the StateControllers running on a State other than this.
public IEnumerable<StateController> InactiveControllers { get; }
Property Value
List
Gets all registered states.
public static IEnumerable<State> List { get; }
Property Value
Name
Gets the state's name.
public virtual string Name { get; }
Property Value
Methods
Get(byte)
Gets the State belonging to the specified id.
public static State Get(byte id)
Parameters
id
byteThe state's id.
Returns
Get(byte, byte)
Gets the States belonging to the specified id between the defined range.
public static IEnumerable<State> Get(byte minRange, byte maxRange)
Parameters
Returns
- IEnumerable<State>
All States belonging to the specified id between the specified range.
Get(params byte[])
Gets the States belonging to the specified id between the defined ids.
public static IEnumerable<State> Get(params byte[] ids)
Parameters
ids
byte[]The ids to look for.
Returns
- IEnumerable<State>
All States belonging to the specified id between the defined ids.
Get(string)
Gets the State belonging to the specified name.
public static State Get(string name)
Parameters
name
stringThe state's name.
Returns
Get(params string[])
Gets the States belonging to the specified id between the defined names.
public static IEnumerable<State> Get(params string[] names)
Parameters
names
string[]The names to look for.
Returns
- IEnumerable<State>
All States belonging to the specified id between the defined names.
Get(Type)
public static State Get(Type type)
Parameters
Returns
Get(params Type[])
Gets the States belonging to the specified id between the defined types.
public static IEnumerable<State> Get(params Type[] types)
Parameters
types
Type[]The types to look for.
Returns
- IEnumerable<State>
All States belonging to the specified id between the defined types.
Get<T>()
Gets the State belonging to the specified type T
.
public static T Get<T>() where T : State
Returns
Type Parameters
T
The type to look for.
InitializeStates(bool)
Initializes all states defined in the executing Assembly.
public static void InitializeStates(bool useAttribute = true)
Parameters
useAttribute
boolA value indicating whether attribute should be used.
OnEnter(StateController)
Fired when entering the state.
public virtual void OnEnter(StateController stateController)
Parameters
stateController
StateControllerThe state controller.
OnExit(StateController)
Fired when exiting the state.
public virtual void OnExit(StateController stateController)
Parameters
stateController
StateControllerThe state controller.
Tick()
Fired every tick.
protected override void Tick()
ToString()
public override string ToString()
Returns
TryGet(byte, out State)
Tries to get a State given the specified id.
public static bool TryGet(byte id, out State state)
Parameters
Returns
TryGet(string, out State)
Tries to get a State given the specified name.
public static bool TryGet(string name, out State state)
Parameters
Returns
TryGet(Type, out State)
public static bool TryGet(Type type, out State state)
Parameters
Returns
TryGet<T>(out T)
public bool TryGet<T>(out T state) where T : State
Parameters
Returns
Type Parameters
T
The type to look for.