public void OnNotify(NotificationType type, Card card, ZoneType zone, Player player) { foreach (Player p in match.Players) { foreach (Card c in p.Zones.GetCardsInPlay()) { switch (type) { case NotificationType.EnterZone: c.OnCardEnter(zone, card, player); break; case NotificationType.ExitZone: c.OnCardExit(zone, card, player); break; case NotificationType.BeginTurn: c.OnBeginTurn(player); break; case NotificationType.EndTurn: c.OnEndTurn(player); for (int i = 0; i < Global.NumPlayers; i++) { if(!match.Players[i].Equals(player)) { match.Players[i].BeginTurn(); } } break; } } } }
public override void OnBeginTurn(Player player) { base.OnBeginTurn(player); if(IsOwner(player)) { Wake(); } }
public Card(Player owner) { this.Owner = owner; if (owner != null) { this.observer = owner.Match.Observer; } }
public Creature(Player owner, int Attack, int Health) : base(owner) { Sleeping = true; }
public Device(Player owner) : base(owner) { }
public Card GetNewCardInstance(string name, Player owner) { Type cardType = GetCardType(name); return (Card)Activator.CreateInstance(cardType, new object[] {owner}); }
public virtual void OnBeginTurn(Player player) { }
public void Draw(Player target, int numDraws) { for (int i = 0; i < numDraws; i++) { target.Zones.DrawFromDeck(Owner.ClientId); } }
protected bool IsOwner(Player player) { if(player.Equals(Owner)) { return true; } return false; }
public virtual void OnEndTurn(Player player) { }
public virtual void OnCardExit(ZoneType zone, Card card, Player player) { }
public Spell(Player owner) : base(owner) { }