public void ChooseAttack(CharacterStates.BaseState currState, CharacterProperties.Attack currAttack, FightingGameInputCodeBut button, FightingGameInputCodeDir direction = FightingGameInputCodeDir.None)
            {
                InputNotation notation = SelectInputNotation(button, direction);

                List <CharacterProperties.Attack> attackCandidates = charData.SelectAttacks(GetOrientation(), GetGroundRelation(), notation);

                CharacterProperties.Attack attack = charData.ChooseAttackFromSelectability(attackCandidates, currState, currAttack);

                if (attack != null)
                {
                    attackState.SetActiveAttack(attack);
                }
            }
            private InputNotation SelectInputNotation(FightingGameInputCodeBut button, FightingGameInputCodeDir direction)
            {
                InputNotation notation = InputNotation.None;

                switch (button)
                {
                case FightingGameInputCodeBut.A:
                    switch (direction)
                    {
                    case FightingGameInputCodeDir.Neutral:
                    case FightingGameInputCodeDir.None:
                        notation = InputNotation._5A;
                        break;

                    case FightingGameInputCodeDir.DownBack:
                    case FightingGameInputCodeDir.Down:
                    case FightingGameInputCodeDir.DownForward:
                        notation = InputNotation._2A;
                        break;

                    default:
                        notation = InputNotation._5A;
                        break;
                    }
                    break;

                case FightingGameInputCodeBut.B:
                    switch (direction)
                    {
                    case FightingGameInputCodeDir.Neutral:
                    case FightingGameInputCodeDir.None:
                        notation = InputNotation._5B;
                        break;

                    case FightingGameInputCodeDir.DownBack:
                    case FightingGameInputCodeDir.Down:
                    case FightingGameInputCodeDir.DownForward:
                        notation = InputNotation._2B;
                        break;

                    default:
                        notation = InputNotation._5B;
                        break;
                    }
                    break;

                case FightingGameInputCodeBut.C:
                    switch (direction)
                    {
                    case FightingGameInputCodeDir.Neutral:
                    case FightingGameInputCodeDir.None:
                        notation = InputNotation._5C;
                        break;

                    case FightingGameInputCodeDir.DownBack:
                    case FightingGameInputCodeDir.Down:
                    case FightingGameInputCodeDir.DownForward:
                        notation = InputNotation._2C;
                        break;

                    default:
                        notation = InputNotation._5C;
                        break;
                    }
                    break;

                case FightingGameInputCodeBut.D:
                    switch (direction)
                    {
                    case FightingGameInputCodeDir.Neutral:
                    case FightingGameInputCodeDir.None:
                        notation = InputNotation._5D;
                        break;

                    case FightingGameInputCodeDir.DownBack:
                    case FightingGameInputCodeDir.Down:
                    case FightingGameInputCodeDir.DownForward:
                        notation = InputNotation._2D;
                        break;

                    default:
                        notation = InputNotation._5D;
                        break;
                    }
                    break;
                }

                return(notation);
            }
Esempio n. 3
0
 public IAttackCallbackObj Input(InputNotation input)
 {
     this.input = input;
     return(this);
 }
Esempio n. 4
0
            public List <Attack> SelectAttacks(Orientation orientation, GroundRelation groundRelation, InputNotation attackInput)
            {
                // TODO: Create a new IEnumerable class to pull out the filtered values in-place.

                List <Attack> filteredAttacks = attacks
                                                .Select <KeyValuePair <string, Attack>, Attack>(kvp => kvp.Value)
                                                .Where(atk => atk.orientation == orientation && atk.groundRelation == groundRelation && atk.input == attackInput)
                                                .ToList();

                return(filteredAttacks);
            }