Arbor 3: FSM & BT Graph Editor 3.7.0

Public Member Functions | Public Attributes | Protected Member Functions | Properties | List of all members
State Class Reference

Class that represents the state More...

Inheritance diagram for State:

## Public Member Functions
| State (ArborFSMInternal stateMachine, int nodeID, bool resident)
| State constructor More...
void | AddBehaviour (StateBehaviour behaviour)
| Adds the behaviour. More...
StateBehaviour | AddBehaviour (System.Type type)
| Adds the behaviour. More...
T | AddBehaviour< T > ()
| Adds the behaviour. More...
void | InsertBehaviour (int index, StateBehaviour behaviour)
| Insert the behaviour. More...
StateBehaviour | InsertBehaviour (int index, System.Type type)
| Insert the behaviour. More...
T | InsertBehaviour< T > (int index)
| Adds the behaviour. More...
StateBehaviour | GetBehaviourFromIndex (int index)
| Get StateBehavior from index. More...
Object | GetBehaviourObjectFromIndex (int index)
| Get Object of StateBehavior from index. More...
StateBehaviour | GetBehaviour (System.Type type)
| Gets the behaviour. More...
T | GetBehaviour< T > ()
| Gets the behaviour. More...
StateBehaviour[] | GetBehaviours (System.Type type)
| Gets the behaviours. More...
T[] | GetBehaviours< T > ()
| Gets the behaviours. More...
bool | Contains (StateBehaviour behaviour)
| Whether StateBehaviour are included. More...
int | IndexOfBehaviour (Object behaviourObj)
| Return index of StateBehaviour. More...
void | RemoveBehaviour (Object behaviourObj)
| I want to remove the StateBehaviour. More...
void | RemoveBehaviourAt (int behaviourIndex)
| I want to remove the StateBehaviour. More...
void | SwapBehaviour (int fromIndex, int toIndex)
| Swap the order of StateBehaviour. More...
void | MoveBehaviour (int fromIndex, State toState, int toIndex)
| Move the order of StateBehaviour. More...
void | SetBehaviour (int index, StateBehaviour behaviour)
| Set StateBehaviour. More...
override bool | IsContainsBehaviour (NodeBehaviour behaviour)
| Check if it contains NodeBehaviour. More...
void | DisconnectState (int stateID)
| For internal. More...
void | DestroyBehaviour (Object behaviourObj)
| Destroy StateBehaviour More...
void | DestroyBehaviourAt (int behaviourIndex)
| Destroy StateBehaviour More...
void | DestroyBehaviours ()
| For internal. More...
void | UpdateBehaviours ()
| For internal. More...
void | LateUpdateBehaviours ()
| For internal. More...
void | SendTrigger (string message)
| Send a trigger message. More...
override string | GetName ()
| Get node name. More...
Public Member Functions inherited from Node
| Node (NodeGraph nodeGraph, int nodeID)
| Node constructor More...
virtual bool | IsDeletable ()
| Returns whether or not it can be deleted. More...
override string | ToString ()
| Convert node to string (for debugging). More...

## Public Attributes
string | name = "New State"
| The name of the state. More...
Public Attributes inherited from Node
Rect | position
| Position on the Arbor Editor. More...
bool | showComment
| Whether to display comments More...
string | nodeComment
| Comment More...

## Protected Member Functions
override void | OnGraphChanged ()
| Called when the NodeGraph to which the Node belongs has changed. More...

## Properties
ArborFSMInternal | stateMachine`[get]`
| Gets the state machine. More...
StateBehaviour[] | behaviours`[get]`
| Deprecated. More...
int | behaviourCount`[get]`
| Get a count of Behavior. More...
int | stateID`[get]`
| Gets the state identifier. More...
bool | resident`[get]`
| Gets a value indicating whether this State is resident. More...
bool | breakPoint`[get, set]`
| Break point. More...
uint | transitionCount`[get, set]`
| Transition count. More...
Properties inherited from Node
NodeGraph | nodeGraph`[get]`
| Gets the NodeGraph. More...
int | nodeID`[get]`
| Gets the node identifier. More...

## Detailed Description

Class that represents the state

## Constructor & Destructor Documentation

## ◆ State()

State | ( | ArborFSMInternal | stateMachine,
|  | int | nodeID,
|  | bool | resident
| ) |  |

State constructor

Parameters

  stateMachine | StateMachine with this node
  nodeID | Node ID
  resident | Resident state

Please use the ArborFSMInternal.CreateState(bool) state creating.

## Member Function Documentation

## ◆ AddBehaviour() [1/2]

void AddBehaviour | ( | StateBehaviour | behaviour | ) |

Adds the behaviour.

Parameters

  behaviour | Add StateBehaviour

## ◆ AddBehaviour() [2/2]

StateBehaviour AddBehaviour | ( | System.Type | type | ) |

Adds the behaviour.

Parameters

  type | Type of add StateBehaviour

Returns
  Added StateBehaviour

## ◆ AddBehaviour< T >()

T AddBehaviour< T > | ( |  | ) |

Adds the behaviour.

Template Parameters

  T | Type of add StateBehaviour

Returns
  Added StateBehaviour

Type Constraints

  T | : | StateBehaviour |

## ◆ Contains()

bool Contains | ( | StateBehaviour | behaviour | ) |

Whether StateBehaviour are included.

Parameters

  behaviour | Judges StateBehaviour.

Returns
  Whether included are.

## ◆ DestroyBehaviour()

void DestroyBehaviour | ( | Object | behaviourObj | ) |

Destroy StateBehaviour

Parameters

  behaviourObj | The StateBehavior you want to destroy.

## ◆ DestroyBehaviourAt()

void DestroyBehaviourAt | ( | int | behaviourIndex | ) |

Destroy StateBehaviour

Parameters

  behaviourIndex | Index of StateBehaviour you want to destroy.

## ◆ DestroyBehaviours()

void DestroyBehaviours | ( |  | ) |

For internal.

## ◆ DisconnectState()

void DisconnectState | ( | int | stateID | ) |

For internal.

## ◆ GetBehaviour()

StateBehaviour GetBehaviour | ( | System.Type | type | ) |

Gets the behaviour.

Parameters

  type | Type of you want to get StateBehaviour.

Returns
  Found StateBehaviour. Or null if it is not.

## ◆ GetBehaviour< T >()

T GetBehaviour< T > | ( |  | ) |

Gets the behaviour.

Template Parameters

  T | Type of you want to get StateBehaviour.

Returns
  Found StateBehaviour. Or null if it is not.

Type Constraints

  T | : | StateBehaviour |

## ◆ GetBehaviourFromIndex()

StateBehaviour GetBehaviourFromIndex | ( | int | index | ) |

Get StateBehavior from index.

Parameters

  index | Index

Returns
  StateBehaviour

## ◆ GetBehaviourObjectFromIndex()

Object GetBehaviourObjectFromIndex | ( | int | index | ) |

Get Object of StateBehavior from index.

Parameters

  index | Index

Returns
  Object

## ◆ GetBehaviours()

StateBehaviour [] GetBehaviours | ( | System.Type | type | ) |

Gets the behaviours.

Parameters

  type | Type of you want to get StateBehaviour.

Returns
  Array of found StateBehaviour.

## ◆ GetBehaviours< T >()

T [] GetBehaviours< T > | ( |  | ) |

Gets the behaviours.

Template Parameters

  T | Type of you want to get StateBehaviour.

Returns
  Array of found StateBehaviour.

Type Constraints

  T | : | StateBehaviour |

## ◆ GetName()

override string GetName | ( |  | ) |
| virtual

Get node name.

Returns
  Node name

Reimplemented from Node.

## ◆ IndexOfBehaviour()

int IndexOfBehaviour | ( | Object | behaviourObj | ) |

Return index of StateBehaviour.

Parameters

  behaviourObj | The StateBehaviour to locate in the State.

Returns
  Returns an index if found, -1 otherwise.

## ◆ InsertBehaviour() [1/2]

void InsertBehaviour | ( | int | index,
|  | StateBehaviour | behaviour
| ) |  |

Insert the behaviour.

Parameters

  index | Insertion destination index
  behaviour | Insert StateBehaviour

## ◆ InsertBehaviour() [2/2]

StateBehaviour InsertBehaviour | ( | int | index,
|  | System.Type | type
| ) |  |

Insert the behaviour.

Parameters

  index | Insertion destination index
  type | Type of add StateBehaviour

Returns
  Inserted StateBehaviour

## ◆ InsertBehaviour< T >()

T InsertBehaviour< T > | ( | int | index | ) |

Adds the behaviour.

Template Parameters

  T | Type of insert StateBehaviour

Parameters

  index | Insertion destination index

Returns
  Inserted StateBehaviour

Type Constraints

  T | : | StateBehaviour |

## ◆ IsContainsBehaviour()

override bool IsContainsBehaviour | ( | NodeBehaviour | behaviour | ) |
| virtual

Check if it contains NodeBehaviour.

Parameters

  behaviour | Check NodeBehaviour

Returns
  Returns true if it contains NodeBehaviour.

Reimplemented from Node.

## ◆ LateUpdateBehaviours()

void LateUpdateBehaviours | ( |  | ) |

For internal.

## ◆ MoveBehaviour()

void MoveBehaviour | ( | int | fromIndex,
|  | State | toState,
|  | int | toIndex
| ) |  |

Move the order of StateBehaviour.

Parameters

  fromIndex | The moving want index.
  toState | The destination State.
  toIndex | The destination index.

## ◆ OnGraphChanged()

override void OnGraphChanged | ( |  | ) |
| protected virtual

Called when the NodeGraph to which the Node belongs has changed.

Reimplemented from Node.

## ◆ RemoveBehaviour()

void RemoveBehaviour | ( | Object | behaviourObj | ) |

I want to remove the StateBehaviour.

For instance is not deleted, that you use the StateBehaviour.Destroy.

Parameters

  behaviourObj | StateBehaviour you want to remove.

## ◆ RemoveBehaviourAt()

void RemoveBehaviourAt | ( | int | behaviourIndex | ) |

I want to remove the StateBehaviour.

For instance is not deleted, that you use the StateBehaviour.Destroy.

Parameters

  behaviourIndex | Index of StateBehaviour to remove.

## ◆ SendTrigger()

void SendTrigger | ( | string | message | ) |

Send a trigger message.

StateBehaviour.OnStateTrigger is called.

Parameters

  message | Message to be sent

## ◆ SetBehaviour()

void SetBehaviour | ( | int | index,
|  | StateBehaviour | behaviour
| ) |  |

Set StateBehaviour.

Parameters

  index | Index
  behaviour | StateBehaviour

Note that the original StateBehaviour does not Destroy. If you want to add StateBehaviour, please use AddBehaviour. If you want to do Destroy please use DestroyBehaviour.

## ◆ SwapBehaviour()

void SwapBehaviour | ( | int | fromIndex,
|  | int | toIndex
| ) |  |

Swap the order of StateBehaviour.

Parameters

  fromIndex | The swapping want index.
  toIndex | Exchange destination index.

## ◆ UpdateBehaviours()

void UpdateBehaviours | ( |  | ) |

For internal.

## Member Data Documentation

## ◆ name

string name = "New State"

The name of the state.

## Property Documentation

## ◆ behaviourCount

int behaviourCount
| get

Get a count of Behavior.

## ◆ behaviours

StateBehaviour [] behaviours
| get

Deprecated.

Use behaviourCount and GetBehaviourFromIndex.

## ◆ breakPoint

bool breakPoint
| get set

Break point.

When this property is true, the editor is in a pause state at the timing of entering the state.

## ◆ resident

bool resident
| get

Gets a value indicating whether this State is resident.

## ◆ stateID

int stateID
| get

Gets the state identifier.

## ◆ stateMachine

ArborFSMInternal stateMachine
| get

Gets the state machine.

## ◆ transitionCount

uint transitionCount
| get set

Transition count.