示例#1
0
 private void RequestBuff()
 {
     if (this.m_Owner == null)
     {
         return;
     }
     for (int index1 = 0; index1 < this.m_Owner.BuffAttachments.Count; ++index1)
     {
         BuffAttachment buffAttachment = this.m_Owner.BuffAttachments[index1];
         if (!(bool)buffAttachment.IsPassive && this.GetObject(buffAttachment) == null)
         {
             foreach (UnitBuffDisplayNode.Param obj in UnitBuffDisplayNode.CreateParams(this, this.m_Owner, buffAttachment))
             {
                 UnitBuffDisplay.Object @object = (UnitBuffDisplay.Object)null;
                 for (int index2 = 0; index2 < this.m_Objects.Count; ++index2)
                 {
                     if (this.m_Objects[index2].IsEqual(obj))
                     {
                         @object = this.m_Objects[index2];
                         break;
                     }
                 }
                 if (@object == null)
                 {
                     this.m_Objects.Add(new UnitBuffDisplay.Object(obj));
                 }
                 else
                 {
                     @object.Add(obj);
                 }
             }
         }
     }
 }
示例#2
0
 public Object(UnitBuffDisplayNode.Param param)
 {
     this.paramlist.Add(param);
     this.dispType   = param.dispType;
     this.effectType = param.effectType;
     this.node       = (UnitBuffDisplayNode)null;
 }
        public static UnitBuffDisplayNode.Param[] CreateParams(UnitBuffDisplay parent, Unit owner, BuffAttachment buff)
        {
            List <UnitBuffDisplayNode.Param> objList = new List <UnitBuffDisplayNode.Param>();

            for (int index = 1; index < 5; ++index)
            {
                UnitBuffDisplayNode.BuffType buffType = (UnitBuffDisplayNode.BuffType)index;
                if ((double)UnitBuffDisplayNode.GetValue(buffType, buff) != 0.0)
                {
                    UnitBuffDisplay.NodeData nodeData = parent.GetNodeData(buffType);
                    if (nodeData != null)
                    {
                        objList.Add(new UnitBuffDisplayNode.Param(owner, buff, nodeData));
                    }
                }
            }
            if (objList.Count == 0)
            {
                objList.Add(new UnitBuffDisplayNode.Param(owner, buff, (UnitBuffDisplay.NodeData)null));
            }
            return(objList.ToArray());
        }