예제 #1
0
    public void Resolve(MovementState movementState)
    {
        var defenseState = defenseController.Resolve(movementState);
        var attackState  = attackController.Resolve(movementState);

        switch (defenseState)
        {
        case DefenseState.Blocking:
        case DefenseState.Hit:
        case DefenseState.PreBlock:
        case DefenseState.PreHit:
            if (attackState != AttackState.None)
            {
                attackController.Cancel();
            }
            this.state = ADStateAlt.Defending;
            break;

        default:
            switch (attackState)
            {
            case AttackState.PreMove:
            case AttackState.Startup:
            case AttackState.Active:
            case AttackState.Recovery:
                this.state = ADStateAlt.Attacking;
                break;

            default:
                this.state = ADStateAlt.None;
                break;
            }

            break;
        }
    }