示例#1
0
文件: EnDa.cs 项目: zhaoyingju/ccflow
        public static int Retrieve(Entity en, string sql, Paras paras)
        {
            DataTable dt;

            switch (en.EnMap.EnDBUrl.DBUrlType)
            {
            case DBUrlType.AppCenterDSN:
                dt = DBAccess.RunSQLReturnTable(sql, paras);
                break;

            case DBUrlType.DBAccessOfMSMSSQL:
                dt = DBAccessOfMSMSSQL.RunSQLReturnTable(sql);
                break;

            case DBUrlType.DBAccessOfOracle:
                dt = DBAccessOfOracle.RunSQLReturnTable(sql);
                break;

            default:
                throw new Exception("@没有设置DB类型。");
            }

            if (dt.Rows.Count == 0)
            {
                return(0);
            }
            Attrs attrs = en.EnMap.Attrs;

            EnDA.fullDate(dt, en, attrs);
            int i = dt.Rows.Count;

            dt.Dispose();
            return(i);
        }
示例#2
0
        public Map GenerMap()
        {
            bool isdebug = SystemConfig.IsDebug;

            if (isdebug == false)
            {
                Map m = BP.DA.Cash.GetMap(this.No);
                if (m != null)
                {
                    return(m);
                }
            }

            MapAttrs mapAttrs = this.MapAttrs;
            Map      map      = new Map(this.PTable);

            map.EnDesc             = this.Name;
            map.EnType             = EnType.App;
            map.DepositaryOfEntity = Depositary.None;
            map.DepositaryOfMap    = Depositary.Application;

            Attrs attrs = new Attrs();

            foreach (MapAttr mapAttr in mapAttrs)
            {
                map.AddAttr(mapAttr.HisAttr);
            }

            BP.DA.Cash.SetMap(this.No, map);
            return(map);
        }
示例#3
0
文件: EnDa.cs 项目: zhaoyingju/ccflow
 private static void fullDate(DataTable dt, Entity en, Attrs attrs)
 {
     foreach (Attr attr in attrs)
     {
         en.Row.SetValByKey(attr.Key, dt.Rows[0][attr.Key]);
     }
 }
 protected void TryUpdateBuff()
 {
     if (!DataReader <Buff> .Contains(this.buffID))
     {
         return;
     }
     if (!this.battleUI)
     {
         return;
     }
     this.battleUI.ShowGuildWarBuff(true, 5619, delegate
     {
         if (!DataReader <Buff> .Contains(this.buffID))
         {
             return;
         }
         Buff buff         = DataReader <Buff> .Get(this.buffID);
         string effectText = string.Empty;
         if (DataReader <Attrs> .Contains(buff.targetPropId))
         {
             Attrs attrs = DataReader <Attrs> .Get(buff.targetPropId);
             if (attrs.attrs.get_Count() > 0 && attrs.values.get_Count() > 0)
             {
                 effectText = AttrUtility.GetStandardDesc(attrs.attrs.get_Item(0), attrs.values.get_Item(0));
             }
         }
         BattleBuffDetailUI battleBuffDetailUI = UIManagerControl.Instance.OpenUI("BattleBuffDetailUI", null, false, UIType.NonPush) as BattleBuffDetailUI;
         if (battleBuffDetailUI)
         {
             battleBuffDetailUI.SetData(5619, 515122, 515123, effectText, 515121);
         }
     });
 }
示例#5
0
    private void SetAttrCurr(int wingId, bool isActivation)
    {
        int    wingLv     = WingManager.GetWingLv(wingId);
        wingLv wingLvInfo = WingManager.GetWingLvInfo(wingId, wingLv);
        Text   component  = base.get_transform().Find("txtName").GetComponent <Text>();

        component.set_text(TextColorMgr.GetColorByQuality(wingLvInfo.name, wingLvInfo.color));
        Image component2 = this.m_btnIcon.GetComponent <Image>();

        ResourceManager.SetSprite(component2, GameDataUtils.GetIcon(wingLvInfo.icon));
        ImageColorMgr.SetImageColor(component2, !isActivation);
        if (wingLv == 0)
        {
            this.m_attrCurr.Find("txtLv").GetComponent <Text>().set_text("激活后");
        }
        else
        {
            this.m_attrCurr.Find("txtLv").GetComponent <Text>().set_text("Lv." + wingLv);
        }
        Attrs attrs = DataReader <Attrs> .Get(wingLvInfo.templateId);

        for (int i = 0; i < 6; i++)
        {
            if (i < attrs.attrs.get_Count())
            {
                Debug.Log(attrs.attrs.get_Item(i) + "=" + (AttrType)attrs.attrs.get_Item(i));
                this.m_attrCurr.Find("txtAttrName" + (i + 1)).get_gameObject().SetActive(true);
                this.m_attrCurr.Find("txtAttrName" + (i + 1)).GetComponent <Text>().set_text(AttrUtility.GetStandardAddDesc(attrs.attrs.get_Item(i), attrs.values.get_Item(i), "ff7d4b"));
            }
            else
            {
                this.m_attrCurr.Find("txtAttrName" + (i + 1)).get_gameObject().SetActive(false);
            }
        }
    }
示例#6
0
 public NodeFormat()
 {
     Name = "format";
     Attrs.Add("FontSize", "10");
     Attrs.Add("FontName", "宋体");
     Attrs.Add("Rotate", "0");
 }
示例#7
0
        /// <summary>
        /// 将实体类转为json格式List
        /// </summary>
        /// <param name="ens"></param>
        /// <param name="hidenKeys">隐藏字段</param>
        /// <returns></returns>
        public string TranslateEntitiesToListJson(BP.En.Entities ens, string hidenKeys)
        {
            Attrs         attrs  = ens.GetNewEntity.EnMap.Attrs;
            StringBuilder append = new StringBuilder();

            append.Append("[");

            foreach (Entity en in ens)
            {
                append.Append("{");
                foreach (Attr attr in attrs)
                {
                    if (!string.IsNullOrEmpty(hidenKeys) && hidenKeys.Contains("@" + attr.Key))
                    {
                        continue;
                    }

                    string strValue = en.GetValStrByKey(attr.Key);
                    if (!string.IsNullOrEmpty(strValue) && strValue.LastIndexOf("\\") > -1)
                    {
                        strValue = strValue.Substring(0, strValue.LastIndexOf("\\"));
                    }
                    append.Append(attr.Key + ":'" + strValue + "',");
                }
                append = append.Remove(append.Length - 1, 1);
                append.Append("},");
            }
            if (append.Length > 1)
            {
                append = append.Remove(append.Length - 1, 1);
            }
            append.Append("]");
            return(ReplaceIllgalChart(append.ToString()));
        }
示例#8
0
    public static long GetCurrentWingFightingValue()
    {
        long num = 0L;

        if (WingManager.wingInfoDict == null)
        {
            return(num);
        }
        using (Dictionary <int, WingInfo> .Enumerator enumerator = WingManager.wingInfoDict.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                KeyValuePair <int, WingInfo> current = enumerator.get_Current();
                int cfgId = current.get_Value().cfgId;
                int lv    = current.get_Value().lv;
                if (cfgId > 0)
                {
                    wingLv wingLvInfo = WingManager.GetWingLvInfo(cfgId, lv);
                    if (wingLvInfo != null)
                    {
                        int   templateId = wingLvInfo.templateId;
                        Attrs attrs      = DataReader <Attrs> .Get(templateId);

                        if (attrs != null)
                        {
                            num += EquipGlobal.CalculateFightingByIDAndValue(attrs.attrs, attrs.values);
                        }
                    }
                }
            }
        }
        return(num);
    }
示例#9
0
        protected void CheckFloatText(Buff buffData)
        {
            if (buffData.text == 0)
            {
                return;
            }
            BuffType type = (BuffType)buffData.type;

            if (type != BuffType.ChangeAttrs)
            {
                FloatTipManager.Instance.AddFloatTip(this.owner.ID, this.owner.Actor.FixTransform, GameDataUtils.GetChineseContent(buffData.text, false), string.Empty, true, 2.5f, 1f, 1f, 150f);
            }
            else
            {
                Attrs attrs = DataReader <Attrs> .Get(buffData.targetPropId);

                if (attrs != null)
                {
                    for (int i = 0; i < attrs.attrs.get_Count(); i++)
                    {
                        FloatTipManager.Instance.AddFloatTip(this.owner.ID, this.owner.Actor.FixTransform, string.Format(GameDataUtils.GetChineseContent(buffData.text, false), AttrUtility.GetAttrName((AttrType)attrs.attrs.get_Item(i)), (float)attrs.values.get_Item(i)), string.Empty, true, 2.5f, 1f, 1f, 150f);
                    }
                }
            }
        }
示例#10
0
    private bool RefreshInitActPoint(talent_template dataTT)
    {
        if (dataTT.type == 1)
        {
            int   key   = int.Parse(GameDataUtils.SplitString4Dot0(dataTT.ruleDetail));
            Attrs attrs = DataReader <Attrs> .Get(key);

            if (attrs == null)
            {
                return(true);
            }
            for (int i = 0; i < attrs.attrs.get_Count(); i++)
            {
                if (attrs.attrs.get_Item(i) == 106)
                {
                    if (i < attrs.values.get_Count())
                    {
                        this.InitActPoint += attrs.values.get_Item(i);
                    }
                    return(true);
                }
            }
        }
        return(false);
    }
示例#11
0
    public long GetAllGodSoliderAttrValue()
    {
        long num = 0L;

        if (this.mGodList != null)
        {
            List <int> list  = new List <int>();
            List <int> list2 = new List <int>();
            for (int i = 0; i < this.mGodList.get_Count(); i++)
            {
                GodWeaponInfo godWeaponInfo = this.mGodList.get_Item(i);
                if (godWeaponInfo.isOpen && godWeaponInfo.gLevel > 0)
                {
                    Attrs attrs = DataReader <Attrs> .Get(this.mTypeLevelDict.get_Item(godWeaponInfo.Type).get_Item(godWeaponInfo.gLevel).attrID);

                    if (attrs != null)
                    {
                        for (int j = 0; j < attrs.attrs.get_Count(); j++)
                        {
                            list.Add(attrs.attrs.get_Item(j));
                            list2.Add(attrs.values.get_Item(j));
                        }
                    }
                }
            }
            num += EquipGlobal.CalculateFightingByIDAndValue(list, list2);
        }
        return(num);
    }
示例#12
0
        public NodePage()
        {
            Name = "Page";
            Attrs.Add("Num", "1");
            for (int i = 0; i < Config.DefaultElementNumList.Length; i++)
            {
                Dictionary <string, object> childAttrs = new Dictionary <string, object>();
                childAttrs.Add("Num", Config.DefaultElementNumList[i]);
                childAttrs.Add("Key", Config.DefaultElementKeyList[i]);
                childAttrs.Add("Type", Config.DefaultElementTypeList[i]);
                childAttrs.Add("Desc", Config.DefaultElementDescList[i]);

                List <NodeBase> childChildNodes = new List <NodeBase>();
                childChildNodes.Add(new NodeFormat(Config.DefaultElementTypeList[i]));
                childChildNodes.Add(Config.DefaultElementPositionList[i]);
                if (Config.DefaultElementKeyList[i].Substring(0, 1) != "1")
                {
                    childChildNodes.Add(new NodeRequirement(Config.DefaultElementKeyList[i]));
                }
                childChildNodes.Add(new NodeBase {
                    Name = "data", Content = Config.DefaultElementDataList[i], Attrs = null, ChildNodes = null
                });

                ChildNodes.Add(new NodeBase {
                    Name = "element", Content = "", Attrs = childAttrs, ChildNodes = childChildNodes
                });
            }
        }
示例#13
0
    public int GetSkillProInitActPoint()
    {
        int num = 0;
        List <KeyValuePair <int, int> > skillProDataID = this.GetSkillProDataID();
        int num2 = 106;

        for (int i = 0; i < skillProDataID.get_Count(); i++)
        {
            if (DataReader <skillExtend> .Contains(skillProDataID.get_Item(i).get_Key()))
            {
                skillExtend skillExtend = DataReader <skillExtend> .Get(skillProDataID.get_Item(i).get_Key());

                if (skillExtend.type == 1)
                {
                    int key = int.Parse(GameDataUtils.SplitString4Dot0(skillExtend.ruleDetail));
                    if (DataReader <Attrs> .Contains(key))
                    {
                        Attrs attrs = DataReader <Attrs> .Get(key);

                        for (int j = 0; j < attrs.attrs.get_Count(); j++)
                        {
                            if (attrs.attrs.get_Item(j) == num2)
                            {
                                if (j < attrs.values.get_Count())
                                {
                                    num += attrs.values.get_Item(j);
                                }
                            }
                        }
                    }
                }
            }
        }
        return(num);
    }
示例#14
0
        public string RepairDataIt()
        {
            string infos = "";

            Flow fl = new Flow(this.FK_Flow);
            Node nd = new Node(int.Parse(fl.No + "01"));
            Work wk = nd.HisWork;

            string trackTable = "ND" + int.Parse(fl.No) + "Track";
            string sql        = "SELECT MyPK FROM " + trackTable + " WHERE WorkID=" + this.WorkID + " AND ACTIONTYPE=1 and NDFrom=" + nd.NodeID;
            string mypk       = DBAccess.RunSQLReturnString(sql);

            if (DataType.IsNullOrEmpty(mypk) == true)
            {
                return("err@没有找到track主键。");
            }

            wk.OID = this.WorkID;
            wk.RetrieveFromDBSources();

            string file = "c:\\temp\\" + this.WorkID + ".txt";

            try
            {
                BP.DA.DBAccess.GetFileFromDB(file, trackTable, "MyPK", mypk, "FrmDB");
            }
            catch (Exception ex)
            {
                infos += "@ 错误:" + fl.No + " - Rec" + wk.Rec + " db=" + wk.OID + " - " + fl.Name;
            }

            string    json  = DataType.ReadTextFile(file);
            DataTable dtVal = BP.Tools.Json.ToDataTable(json);

            DataRow mydr = dtVal.Rows[0];

            Attrs attrs  = wk.EnMap.Attrs;
            bool  isHave = false;

            foreach (Attr attr in attrs)
            {
                string jsonVal = mydr[attr.Key].ToString();
                string enVal   = wk.GetValStringByKey(attr.Key);
                if (DataType.IsNullOrEmpty(enVal) == true)
                {
                    wk.SetValByKey(attr.Key, jsonVal);
                    isHave = true;
                }
            }

            if (isHave == true)
            {
                wk.DirectUpdate();
                return("不需要更新数据.");
            }
            infos += "@WorkID=" + wk.OID + " =" + wk.Rec + "  dt=" + wk.RDT + "被修复.";

            return(infos);
        }
示例#15
0
 public string Get(string key)
 {
     if (Attrs.ContainsKey(key))
     {
         return(Attrs[key]);
     }
     return(null);
 }
示例#16
0
        public EnsAppCfg(string ensName, string cfgkey)
        {
            this.MyPK = ensName + "@" + cfgkey;
            try
            {
                this.Retrieve();
            }
            catch
            {
                BP.Sys.Xml.EnsAppXmls xmls = new BP.Sys.Xml.EnsAppXmls();
                int i = xmls.Retrieve(BP.Sys.Xml.EnsAppXmlEnsName.EnsName, ensName,
                                      "No", cfgkey);
                if (i == 0)
                {
                    Attrs attrs = this.EnMap.HisCfgAttrs;
                    foreach (Attr attr in attrs)
                    {
                        if (attr.Key == cfgkey)
                        {
                            this.EnsName = ensName;
                            this.CfgKey  = cfgkey;
                            if (attr.Key == "FocusField")
                            {
                                Entity en = BP.En.ClassFactory.GetEns(ensName).GetNewEntity;
                                if (en.EnMap.Attrs.Contains("Name"))
                                {
                                    this.CfgVal = "Name";
                                }
                                if (en.EnMap.Attrs.Contains("Title"))
                                {
                                    this.CfgVal = "Title";
                                }
                            }
                            else
                            {
                                this.CfgVal = attr.DefaultVal.ToString();
                            }
                            this.Insert();
                            return;
                        }
                    }
                }
                BP.Sys.Xml.EnsAppXml xml = null;
                if (xmls.Count == 0)
                {
                    xml = new Xml.EnsAppXml();
                }
                else
                {
                    xml = xmls[0] as BP.Sys.Xml.EnsAppXml;
                }

                this.EnsName = ensName;
                this.CfgKey  = cfgkey;
                this.CfgVal  = xml.DefVal;
                this.Insert();
            }
        }
        /// <summary>
        /// 将实体类转为json格式 包含列名和数据
        /// </summary>
        /// <param name="ens"></param>
        /// <returns></returns>
        public string TranslateEntitiesToGridJsonColAndData(BP.En.Entities ens)
        {
            Attrs         attrs  = ens.GetNewEntity.EnMap.Attrs;
            StringBuilder append = new StringBuilder();

            append.Append("{");
            //整理列名
            append.Append("columns:[");
            foreach (Attr attr in attrs)
            {
                if (attr.IsRefAttr || attr.UIVisible == false)
                {
                    continue;
                }

                if (attr.Key == this.RefPK)
                {
                    continue;
                }

                append.Append("{");
                append.Append(string.Format("field:'{0}',title:'{1}',width:{2},sortable:true", attr.Key, attr.Desc, attr.UIWidth * 2));
                append.Append("},");
            }
            if (append.Length > 10)
            {
                append = append.Remove(append.Length - 1, 1);
            }
            append.Append("]");

            //整理数据
            bool bHaveData = false;

            append.Append(",data:[");
            foreach (Entity en in ens)
            {
                bHaveData = true;
                append.Append("{");
                foreach (Attr attr in attrs)
                {
                    if (attr.IsRefAttr || attr.UIVisible == false)
                    {
                        continue;
                    }
                    append.Append(attr.Key + ":\"" + en.GetValStrByKey(attr.Key) + "\",");
                }
                append = append.Remove(append.Length - 1, 1);
                append.Append("},");
            }
            if (append.Length > 11 && bHaveData)
            {
                append = append.Remove(append.Length - 1, 1);
            }
            append.Append("]");
            append.Append("}");
            return(append.ToString());
        }
示例#18
0
文件: EnDa.cs 项目: zhaoyingju/ccflow
        public static int Retrieve(Entities ens, string sql)
        {
            try
            {
                DataTable dt = new DataTable();
                switch (ens.GetNewEntity.EnMap.EnDBUrl.DBUrlType)
                {
                case DBUrlType.AppCenterDSN:
                    dt = DBAccess.RunSQLReturnTable(sql);
                    break;

                case DBUrlType.DBAccessOfMSMSSQL:
                    dt = DBAccessOfMSMSSQL.RunSQLReturnTable(sql);
                    break;

                case DBUrlType.DBAccessOfOracle:
                    dt = DBAccessOfOracle.RunSQLReturnTable(sql);
                    break;

                case DBUrlType.DBAccessOfOLE:
                    dt = DBAccessOfOLE.RunSQLReturnTable(sql);
                    break;

                default:
                    throw new Exception("@没有设置DB类型。");
                }

                if (dt.Rows.Count == 0)
                {
                    return(0);
                }

                Map   enMap = ens.GetNewEntity.EnMap;
                Attrs attrs = enMap.Attrs;

                //Entity  en1 = ens.GetNewEntity;
                foreach (DataRow dr in dt.Rows)
                {
                    Entity en = ens.GetNewEntity;
                    //Entity  en = en1.CreateInstance();
                    foreach (Attr attr in attrs)
                    {
                        en.Row.SetValByKey(attr.Key, dr[attr.Key]);
                    }
                    ens.AddEntity(en);
                }
                int i = dt.Rows.Count;
                dt.Dispose();
                return(i);
                //return dt.Rows.Count;
            }
            catch (System.Exception ex)
            {
                // ens.GetNewEntity.CheckPhysicsTable();
                throw new Exception("@在[" + ens.GetNewEntity.EnDesc + "]查询时出现错误:" + ex.Message);
            }
        }
示例#19
0
        /// <summary>
        /// Gets the next interval.
        /// </summary>
        /// <param name="attempts">The number of attempts.</param>
        /// <param name="defaultTimeout">The default timeout.</param>
        /// <returns>The next interval in ms.</returns>
        public int GetNextInterval(int attempts, int defaultTimeout)
        {
            if (Retry != null && Attrs.Contains("auto-retry"))
            {
                return(Retry.GetNextInterval(attempts));
            }

            return(defaultTimeout);
        }
示例#20
0
        public override void Copy(Entity fromEn)
        {
            if (fromEn == null)
            {
                return;
            }

            Attrs attrs = fromEn.EnMap.Attrs;

            foreach (Attr attr in attrs)
            {
                if (attr.Key == WorkAttr.CDT ||
                    attr.Key == WorkAttr.RDT ||
                    attr.Key == WorkAttr.Rec ||
                    attr.Key == WorkAttr.FID ||
                    attr.Key == WorkAttr.OID ||
                    attr.Key == WorkAttr.Emps ||
                    attr.Key == GERptAttr.AtPara ||
                    attr.Key == GERptAttr.BillNo ||
                    attr.Key == GERptAttr.CFlowNo ||
                    attr.Key == GERptAttr.CWorkID ||
                    attr.Key == GERptAttr.FID ||
                    attr.Key == GERptAttr.FK_Dept ||
                    attr.Key == GERptAttr.FK_NY ||
                    attr.Key == GERptAttr.FlowDaySpan ||
                    attr.Key == GERptAttr.FlowEmps ||
                    attr.Key == GERptAttr.FlowEnder ||
                    attr.Key == GERptAttr.FlowEnderRDT ||
                    attr.Key == GERptAttr.FlowEndNode ||
                    attr.Key == GERptAttr.FlowNote ||
                    attr.Key == GERptAttr.FlowStarter ||
                    attr.Key == GERptAttr.GuestName ||
                    attr.Key == GERptAttr.GuestNo ||
                    attr.Key == GERptAttr.GUID ||
                    attr.Key == GERptAttr.PEmp ||
                    attr.Key == GERptAttr.PFlowNo ||
                    attr.Key == GERptAttr.PNodeID ||
                    attr.Key == GERptAttr.PWorkID ||
                    attr.Key == GERptAttr.Title ||
                    attr.Key == GERptAttr.PrjNo ||
                    attr.Key == GERptAttr.PrjName ||
                    attr.Key == "No" ||
                    attr.Key == "Name")
                {
                    continue;
                }


                if (attr.Key == GERptAttr.MyNum)
                {
                    this.SetValByKey(attr.Key, 1);
                    continue;
                }
                this.SetValByKey(attr.Key, fromEn.GetValByKey(attr.Key));
            }
        }
        public IViewBuilder ContentMultiple(string property, IEnumerable <Types.IView> content)
        {
            var getter = FSharpValueOption <FSharpFunc <TView, object> > .Some(FuncConvert.FromFunc <TView, object>(control => control.Children));

            var setter = FSharpValueOption <FSharpFunc <Tuple <TView, object>, Unit> > .None;
            var list   = Microsoft.FSharp.Collections.ListModule.OfSeq(content);

            Attrs.Add(Avalonia.FuncUI.Builder.AttrBuilder <TView> .CreateContentMultiple(property, getter, setter, list));
            return(this);
        }
示例#22
0
    private string GetLvDes(int contentID, Attrs attrs)
    {
        string text = GameDataUtils.GetChineseContent(contentID, false);

        for (int i = 0; i < attrs.values.get_Count(); i++)
        {
            text = text.Replace("{num" + (i + 1).ToString() + "}", "<color=white>" + (attrs.values.get_Item(i) * 100).ToString("0.0") + "%</color>");
        }
        return(text);
    }
示例#23
0
 //Should i remove flying everytime?
 public object PostDamagePhase(bool item2)
 {
     if (item2 && Attrs != null)
     {
         var list = Attrs.ToList();
         list.RemoveAll((attr) => attr.Matches(Attributes.Attributes.Flying));
         Attrs = list.ToArray();
         //Attrs.ToList().Where((attr)=> attr.Matches(Attributes.Attributes.Flying));
     }
     return(null);
 }
示例#24
0
        /// <summary>
        /// 获得分组的数据源
        /// </summary>
        /// <returns></returns>
        public string Dot2Dot_GenerGroupEntitis()
        {
            string key = this.GetRequestVal("DefaultGroupAttrKey");

            //实体集合.
            string   ensName = this.GetRequestVal("EnsOfM");
            Entities ens     = ClassFactory.GetEns(ensName);
            Entity   en      = ens.GetNewEntity;

            Attrs attrs = en.EnMap.Attrs;
            Attr  attr  = attrs.GetAttrByKey(key);

            if (attr == null)
            {
                return("err@设置的分组外键错误[" + key + "],不存在[" + ensName + "]或者已经被删除.");
            }

            if (attr.MyFieldType == FieldType.Normal)
            {
                return("err@设置的默认分组[" + key + "]不能是普通字段.");
            }

            if (attr.MyFieldType == FieldType.FK)
            {
                Entities ensFK = attr.HisFKEns;
                ensFK.Clear();
                ensFK.RetrieveAll();
                return(ensFK.ToJson());
            }

            if (attr.MyFieldType == FieldType.Enum)
            {
                /* 如果是枚举 */
                SysEnums ses = new SysEnums();
                ses.Retrieve(SysEnumAttr.IntKey, attr.UIBindKey);

                //ses.ToStringOfSQLModelByKey

                BP.Pub.NYs nys = new Pub.NYs();
                foreach (SysEnum item in ses)
                {
                    BP.Pub.NY ny = new Pub.NY();
                    ny.No   = item.IntKey.ToString();
                    ny.Name = item.Lab;
                    nys.AddEntity(ny);
                }
                return(nys.ToJson());
            }

            return("err@设置的默认分组[" + key + "]不能是普通字段.");
        }
示例#25
0
    private void ShowFightPower(int attrId)
    {
        Attrs attrs = DataReader <Attrs> .Get(attrId);

        if (attrs != null)
        {
            long num = EquipGlobal.CalculateFightingByIDAndValue(attrs.attrs, attrs.values);
            if (num > 0L)
            {
                FightingUpUI fightingUpUI = UIManagerControl.Instance.OpenUI("FightingUpUI", UINodesManager.T2RootOfSpecial, false, UIType.NonPush) as FightingUpUI;
                fightingUpUI.SetPowerUp(num, null);
            }
        }
    }
    public void RemoveValuesByTemplateID(int templateID)
    {
        Attrs attrs = DataReader <Attrs> .Get(templateID);

        if (attrs == null)
        {
            Debug.LogError("Could not found attr template config, templId: " + templateID);
            return;
        }
        for (int i = 0; i < attrs.attrs.get_Count(); i++)
        {
            this.RemoveValue((AttrType)attrs.attrs.get_Item(i), attrs.values.get_Item(i), true);
        }
    }
示例#27
0
    public static XDict <GameData.AttrType, long> GetEffectCasterTempAttr(Effect effectData, EntityParent caster, int fromSkillID)
    {
        XDict <GameData.AttrType, long> xDict = new XDict <GameData.AttrType, long>();
        int skillLevelByID = caster.GetSkillLevelByID(fromSkillID);
        XDict <GameData.AttrType, BattleSkillAttrAdd> skillAttrChangeByID = caster.GetSkillAttrChangeByID(fromSkillID);

        if ((caster.IsEntitySelfType || caster.IsEntityPlayerType || caster.IsEntityPetType) && effectData.rolePropId.get_Count() > 0 && skillLevelByID > 0)
        {
            for (int i = 0; i < effectData.rolePropId.get_Count(); i++)
            {
                if (effectData.rolePropId.get_Item(i).key == skillLevelByID)
                {
                    Attrs attrs = DataReader <Attrs> .Get(effectData.rolePropId.get_Item(i).value);

                    if (attrs != null)
                    {
                        for (int j = 0; j < attrs.attrs.get_Count(); j++)
                        {
                            xDict.Add((GameData.AttrType)attrs.attrs.get_Item(j), (long)attrs.values.get_Item(j));
                        }
                    }
                    break;
                }
            }
        }
        else if (effectData.propId > 0)
        {
            Attrs attrs2 = DataReader <Attrs> .Get(effectData.propId);

            if (attrs2 != null)
            {
                for (int k = 0; k < attrs2.attrs.get_Count(); k++)
                {
                    xDict.Add((GameData.AttrType)attrs2.attrs.get_Item(k), (long)attrs2.values.get_Item(k));
                }
            }
        }
        if (skillAttrChangeByID != null)
        {
            for (int l = 0; l < skillAttrChangeByID.Count; l++)
            {
                if (xDict.ContainsKey(skillAttrChangeByID.Keys.get_Item(l)))
                {
                    xDict[skillAttrChangeByID.Keys.get_Item(l)] = (long)((double)(xDict[skillAttrChangeByID.Keys.get_Item(l)] + (long)skillAttrChangeByID.Values.get_Item(l).addiAdd) * (1.0 + (double)skillAttrChangeByID.Values.get_Item(l).multiAdd * 0.001));
                }
            }
        }
        return(xDict);
    }
示例#28
0
        public void AddJSEvent(Entity en)
        {
            Attrs attrs = en.EnMap.Attrs;

            foreach (Attr attr in attrs)
            {
                if (attr.UIIsReadonly || attr.UIVisible == false)
                {
                    continue;
                }
                if (attr.IsFKorEnum)
                {
                    var ddl = this.UCEn1.GetDDLByID("DDL_" + attr.Key);
                }
            }
        }
    protected static XDict <GameData.AttrType, long> GetBuffCasterTempAttr(Buff buffData, EntityParent caster, int fromSkillLevel, XDict <GameData.AttrType, BattleSkillAttrAdd> casterTempAttrsChange)
    {
        XDict <GameData.AttrType, long> xDict = new XDict <GameData.AttrType, long>();

        if ((caster.IsEntitySelfType || caster.IsEntityPlayerType || caster.IsEntityPetType) && buffData.rolePropId.get_Count() > 0 && fromSkillLevel > 0)
        {
            for (int i = 0; i < buffData.rolePropId.get_Count(); i++)
            {
                if (buffData.rolePropId.get_Item(i).key == fromSkillLevel)
                {
                    Attrs attrs = DataReader <Attrs> .Get(buffData.rolePropId.get_Item(i).value);

                    if (attrs != null)
                    {
                        for (int j = 0; j < attrs.attrs.get_Count(); j++)
                        {
                            xDict.Add((GameData.AttrType)attrs.attrs.get_Item(j), (long)attrs.values.get_Item(j));
                        }
                    }
                    break;
                }
            }
        }
        else if (buffData.propId > 0)
        {
            Attrs attrs2 = DataReader <Attrs> .Get(buffData.propId);

            if (attrs2 != null)
            {
                for (int k = 0; k < attrs2.attrs.get_Count(); k++)
                {
                    xDict.Add((GameData.AttrType)attrs2.attrs.get_Item(k), (long)attrs2.values.get_Item(k));
                }
            }
        }
        if (casterTempAttrsChange != null)
        {
            for (int l = 0; l < casterTempAttrsChange.Count; l++)
            {
                if (xDict.ContainsKey(casterTempAttrsChange.Keys.get_Item(l)))
                {
                    xDict[casterTempAttrsChange.Keys.get_Item(l)] = (long)((double)(xDict[casterTempAttrsChange.Keys.get_Item(l)] + (long)casterTempAttrsChange.Values.get_Item(l).addiAdd) * (1.0 + (double)casterTempAttrsChange.Values.get_Item(l).multiAdd * 0.001));
                }
            }
        }
        return(xDict);
    }
示例#30
0
        public bool IsChange(GEDtl dtl)
        {
            Attrs attrs = dtl.EnMap.Attrs;

            foreach (Attr attr in attrs)
            {
                if (this.GetValByKey(attr.Key) == dtl.GetValByKey(attr.Key))
                {
                    continue;
                }
                else
                {
                    return(true);
                }
            }
            return(false);
        }