示例#1
0
        public static void sendMessage(ICollection <Player> receiverPlayers, Minion minion, MinionEffect effect)
        {
            RawMessage msg = new RawMessage();

            msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GAddEffectOnMinion)));

            if (receiverPlayers != null && receiverPlayers.Count != 0)
            {
                msg.putInt("iid", minion.instanceId);
                msg.putInt("tid", TypeIdGenerator.getMinionEffectId(effect.GetType()));

                foreach (var receiverPlayer in receiverPlayers)
                {
                    receiverPlayer.user.session.client.SendMessage(msg);
                }
            }
        }
示例#2
0
 public bool addEffect(MinionEffect mEffect)
 {
     if (!mEffect.isStackable())
     {
         LinkedListNode <MinionEffect> effectNode = effects.First;
         while (effectNode != null)
         {
             if (effectNode.Value.GetType() == mEffect.GetType())
             {
                 return(false);
             }
             effectNode = effectNode.Next;
         }
     }
     this.effects.AddFirst(mEffect);
     return(true);
 }