---
description: State의 Transition 정의와 관련된 기능을 담당하는 컨트롤
---

# StateTransitionControl

### GetStateTransitions

```csharp
public override List<StateTransition> GetStateTransitions(StateActionMap stateActionMap)
```

#### 정의

정의된 StateActionMap을 바탕으로 다음 Stage로 전이될 State Transition들을 반환합니다.

#### 매개 변수

<table><thead><tr><th width="217">Type</th><th>Description</th></tr></thead><tbody><tr><td>StateActionMap</td><td>Transition 대상 State 입니다.</td></tr></tbody></table>

#### 반환

<table><thead><tr><th width="237">Type</th><th width="309">Description</th><th>Default</th></tr></thead><tbody><tr><td>List&#x3C;StateTransition></td><td>State Transition 리스트 입니다.</td><td><a href="#statetransion">Default Logic 참조</a></td></tr></tbody></table>

#### 예제 (Default Logic) <a href="#statetransion" id="statetransion"></a>

```csharp
public List<StateTransition> GetStateTransitions(StateActionMap stateActionMap) 
{
    List<StateTransition> trans = new List<StateTransition>();

    StateTransition tran = new StateTransition();

    tran.FromState = stateActionMap.PostActionState;
    tran.ToState = stateActionMap.PostActionState.Clone();
    tran.Cost = stateActionMap.Cost;

    trans.Add(tran);

    return trans;
}
```

### GetFinalStateTransition

```csharp
public override StateTransition GetFinalStateTransition(State state)
```

#### 정의

주어진 State로 부터 Final State로의 StateTransition을 정의합니다.

#### 매개변수

<table><thead><tr><th width="301">Type</th><th>Description</th></tr></thead><tbody><tr><td>State</td><td>Final State로 전이할 대상 State 입니다.</td></tr></tbody></table>

#### 반환

<table><thead><tr><th width="205.33333333333331">Type</th><th width="323">Description</th><th>Default</th></tr></thead><tbody><tr><td>StateTransition</td><td>Final State로의 StateTransition 입니다.</td><td><a href="#default-logic">Default Logic 참조</a></td></tr></tbody></table>

#### 예제 (Default Logic)

```csharp
public virtual StateTransition GetFinalStateTransition(State state)
{
    DataModel.StateTransition tran = new DataModel.StateTransition();

    State finalState = new State();
    finalState.IsFinal = true;

    tran.FromState = state;
    tran.ToState = finalState;

    return tran;
}
```
