Exemplo n.º 1
0
        protected bool PushChild(MTGEvent child)
        {
            var result = MTG.Instance.PushEvent(child);

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