예제 #1
0
    public IEnumerator KillWithContext(Card killer, DeathContext context, System.Action <bool> callback)
    {
        //Check Context
        if (killer.CanKill(this) && this.CanBeKilledBy(killer))
        {
            if (IsAlive)
            {
                if (Logic is IOnKilled)
                {
                    bool onKilledFinished = false;
                    ((IOnKilled)Logic).OnKilled(killer, context, (() => onKilledFinished = true));
                    while (!onKilledFinished)
                    {
                        yield return(null);
                    }
                }
            }

            Kill(false);
            CustomConsole.Log(killer.CardName + " killed " + CardName + ". Context: " + context.ToString(), Color.red);
            callback(true);
        }
        else
        {
            callback(false);
        }
    }
예제 #2
0
 public bool KillWithContextNoTriggers(Card killer, DeathContext context)
 {
     //Check Context
     if (killer.CanKill(this) && this.CanBeKilledBy(killer))
     {
         Kill(true);
         CustomConsole.Log(killer.CardName + " killed " + CardName + ". Context: " + context.ToString(), Color.red);
         return(true);
     }
     return(false);
 }
예제 #3
0
 void IOnKilled.OnKilled(Card killer, DeathContext context, System.Action callback)
 {
     if (context == DeathContext.DEFENDING)
     {
         foreach (byte b in killer.LastOwner.Hand.CardsOwned)
         {
             Card.Networking.GiveControl(Card.LastOwner.PlayerIndex, b);
         }
     }
     callback();
 }
예제 #4
0
 void IOnKilled.OnKilled(Card killer, DeathContext context, System.Action callback)
 {
     if (context == DeathContext.DEFENDING)
     {
         Card.StartCoroutine(doTriggerCOR(killer, context, (() => callback())));
     }
     else
     {
         callback();
     }
 }
예제 #5
0
    IEnumerator doTriggerCOR(Card killer, DeathContext context, System.Action callback)
    {
        bool finished = false;

        killer.StartCoroutine(killer.Flip(true, (b) =>
        {
            finished = true;
        }));

        while (!finished)
        {
            yield return(null);
        }

        finished = false;

        killer.StartCoroutine(killer.KillWithContext(Card, DeathContext.OTHER, ((actuallyDied) => finished = true)));
        while (!finished)
        {
            yield return(null);
        }

        callback();
    }
예제 #6
0
 public ParamRepository(DeathContext context)
 {
     _dbcontext = context;
 }
예제 #7
0
 public EFUnitOfWork(string connectionString)
 {
     _dbcontext = new DeathContext(connectionString);
 }
예제 #8
0
 public CacheDataRepository(DeathContext context)
 {
     _dbcontext = context;
 }
예제 #9
0
 void IOnKilled.OnKilled(Card killer, DeathContext context, System.Action callback)
 {
     Card.StartCoroutine(triggerCOR((() => callback())));
 }
예제 #10
0
 void IOnKilled.OnKilled(Card killer, DeathContext context, System.Action callback)
 {
     CustomConsole.LogNetworked(killer.LastOwner.Identity.Name + " has killed the King! They win!", UnityEngine.Color.yellow);
     Card.Networking.EndGame(killer.LastOwner);
     callback();
 }