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 void OnAttach(Card card) { DeviceEffect(); this.Attached = card; }
public override void PlayFromHand(Card card, int clientId) { throw new NotImplementedException(); }
public void AddCardToPlay(Card card) { Add(ZoneType.Play, card); }
public OpponentZones() : base(new List<ZoneType> { ZoneType.Play, ZoneType.Graveyard }) { mockCard = new Fastlane(null); }
protected void Transfer(ZoneType currentZone, ZoneType newZone, Card card) { ZoneDict[currentZone].Remove(card); card.OnExit(currentZone); Add(newZone, card); }
protected void Add(ZoneType zone, Card card) { card.Zone = zone; ZoneDict[zone].Add(card); card.OnEnter(zone); }
public virtual void PlayFromHand(Card card, int clientId) { Transfer(ZoneType.Hand, ZoneType.Play, card); }
public virtual void GraveyardFromPlay(Card card) { Transfer(ZoneType.Play, ZoneType.Graveyard, card); }
public virtual void OnCardExit(ZoneType zone, Card card, Player player) { }
public override void PlayFromHand(Card card, int clientId) { base.PlayFromHand(card, clientId); listener.SendSerializableToClient(new CardSerializer(card.Name, CardActions.Play), GetOtherClientId(clientId)); }