Beispiel #1
0
        public override void OnTacticalPhase(Interactions.TacticalPhase io)
        {
            var respond = m_playingBack.ReadLine().Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries);
            var verb = respond[0];
            var args = new int[respond.Length - 1];
            for (int i = 1; i < respond.Length; ++i)
            {
                args[i - 1] = Int32.Parse(respond[i]);
            }

            switch (verb)
            {
                case "pa":
                    io.RespondPass();
                    break;
                case "pl":
                    io.RespondPlay(io.PlayCardCandidates.First(c => c.Guid == args[0]));
                    break;
                case "ac":
                    io.RespondActivate(io.ActivateAssistCandidates.First(c => c.Guid == args[0]));
                    break;
                case "sa":
                    io.RespondSacrifice(io.SacrificeCandidates.First(c => c.Guid == args[0]));
                    break;
                case "re":
                    io.RespondRedeem(io.RedeemCandidates.First(c => c.Guid == args[0]));
                    break;
                case "ca":
                    io.RespondCast(io.CastSpellCandidates.First(c => c.Host.Guid == args[0] && c.Host.Behaviors[args[1]] == c));
                    break;
                case "atc":
                    io.RespondAttackCard(io.AttackerCandidates.First(c => c.Guid == args[0]), io.DefenderCandidates.First(c => c.Guid == args[1]));
                    break;
                case "atp":
                    io.RespondAttackPlayer(io.AttackerCandidates.First(c => c.Guid == args[0]), io.Game.Players[args[1]]);
                    break;
                default:
                    throw new NotSupportedException(String.Format("Unrecognized verb {0}", verb));
            }
        }