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); } }
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); }
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(); }
void IOnKilled.OnKilled(Card killer, DeathContext context, System.Action callback) { if (context == DeathContext.DEFENDING) { Card.StartCoroutine(doTriggerCOR(killer, context, (() => callback()))); } else { callback(); } }
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(); }
public ParamRepository(DeathContext context) { _dbcontext = context; }
public EFUnitOfWork(string connectionString) { _dbcontext = new DeathContext(connectionString); }
public CacheDataRepository(DeathContext context) { _dbcontext = context; }
void IOnKilled.OnKilled(Card killer, DeathContext context, System.Action callback) { Card.StartCoroutine(triggerCOR((() => callback()))); }
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(); }