Ejemplo n.º 1
0
        internal List <CardModel> ParseOnDeployAutomaticSkillTarget(LineIndicator line, int slotNumber, SkillTarget target)
        {
            if (target == SkillTarget.CorrespondingEnemyLine)
            {
                return(_lines[(int)line.Opposite()]);
            }

            List <CardModel> cards = _lines[(int)line];

            if (target == SkillTarget.AllInLineExceptMe)
            {
                return(cards.GetAllExceptOne(slotNumber).ToList());
            }
            if (target == SkillTarget.LeftNeighbor)
            {
                return(cards.GetLeftNeighbor(slotNumber).ToList());
            }
            if (target == SkillTarget.BothNeighbors)
            {
                return(cards.GetBothNeighbors(slotNumber).ToList());
            }
            if (target == SkillTarget.RightNeighbor)
            {
                return(cards.GetRightNeighbor(slotNumber).ToList());
            }

            throw new Exception("Unreachable code reached! "
                                + "CardSkillTarget enumerator must have been extended without extending the ParseCardSkillTarget function.");
        }
Ejemplo n.º 2
0
        List <SkillTargetData> ParseOnDeployAutomatic(LineIndicator line, int slotNumber, SkillTarget target)
        {
            var targets = new List <SkillTargetData>();
            List <CardModel> cards;

            // corresponding enemy line
            if (target == SkillTarget.CorrespondingEnemyLine)
            {
                cards = _gameLogic.GetLine(line.Opposite());
                for (int i = 0; i < cards.Count; i++)
                {
                    targets.Add(new SkillTargetData(line.Opposite(), i));
                }

                return(targets);
            }

            // our line
            if (target == SkillTarget.AllInLineExceptMe)
            {
                cards = _gameLogic.GetLine(line).GetAllExceptOne(slotNumber).ToList();
            }
            else if (target == SkillTarget.LeftNeighbor)
            {
                cards = _gameLogic.GetLine(line).GetLeftNeighbor(slotNumber).ToList();
            }
            else if (target == SkillTarget.BothNeighbors)
            {
                cards = _gameLogic.GetLine(line).GetBothNeighbors(slotNumber).ToList();
            }
            else if (target == SkillTarget.RightNeighbor)
            {
                cards = _gameLogic.GetLine(line).GetRightNeighbor(slotNumber).ToList();
            }
            else
            {
                throw new Exception("Unreachable code reached! "
                                    + "CardSkillTarget enumerator must have been extended without extending the ParseCardSkillTarget function.");
            }

            foreach (CardModel model in cards)
            {
                targets.Add(new SkillTargetData(line, model.SlotNumber));
            }

            return(targets);
        }