示例#1
0
        public bool PushEvent(MTGEvent mtgEvent)
        {
            string indentstr = "";

            for (int i = 0; i < indent; i++)
            {
                indentstr += " : ";
            }

            Console.WriteLine($"{indentstr}{mtgEvent.GetType().Name} pushed");
            indent++;
            var result = mtgEvent.Apply();

            indent--;
            Console.WriteLine($"{indentstr}{mtgEvent.GetType().Name} resolved");
            return(result);
        }
示例#2
0
        public IEnumerable <TriggeredAbilityEntry> TriggeredAbilities(MTGEvent mtgevent)
        {
            Type type = mtgevent.GetType();

            if (_allTriggeredAbilities.TryGetValue(type, out var abilities))
            {
                foreach (var ability in abilities)
                {
                    yield return(ability);
                }
            }
        }