Example #1
0
 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;
             }
         }
     }
 }
Example #2
0
 public override void OnBeginTurn(Player player)
 {
     base.OnBeginTurn(player);
     if(IsOwner(player))
     {
         Wake();
     }
 }
Example #3
0
 public Card(Player owner)
 {
     this.Owner = owner;
     if (owner != null)
     {
         this.observer = owner.Match.Observer;
     }
 }
Example #4
0
 public Creature(Player owner, int Attack, int Health)
     : base(owner)
 {
     Sleeping = true;
 }
Example #5
0
 public Device(Player owner)
     : base(owner)
 {
 }
Example #6
0
 public Card GetNewCardInstance(string name, Player owner)
 {
     Type cardType = GetCardType(name);
     return (Card)Activator.CreateInstance(cardType, new object[] {owner});
 }
Example #7
0
 public virtual void OnBeginTurn(Player player)
 {
 }
Example #8
0
 public void Draw(Player target, int numDraws)
 {
     for (int i = 0; i < numDraws; i++)
     {
         target.Zones.DrawFromDeck(Owner.ClientId);
     }
 }
Example #9
0
 protected bool IsOwner(Player player)
 {
     if(player.Equals(Owner))
     {
         return true;
     }
     return false;
 }
Example #10
0
 public virtual void OnEndTurn(Player player)
 {
 }
Example #11
0
 public virtual void OnCardExit(ZoneType zone, Card card, Player player)
 {
 }
Example #12
0
 public Spell(Player owner)
     : base(owner)
 {
 }