예제 #1
0
        protected bool PushChild(MTGEvent child)
        {
            var result = MTG.Instance.PushEvent(child);

            if (result)
            {
                children.AddLast(child);
            }
            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);
                }
            }
        }
예제 #3
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);
        }
예제 #4
0
 public abstract bool DoesTrigger(OID source, MTGEvent mtgevent);
예제 #5
0
 public bool callback(MTGEvent newEvent)
 {
     return(PushChild(newEvent));
 }