Esempio n. 1
0
    public ADController(AttackController attackController, DefenseController defenseController)
    {
        this.state = ADStateAlt.None;

        this.attackController  = attackController;
        this.defenseController = defenseController;
    }
Esempio n. 2
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;
        }
    }