示例#1
0
        public string GetAtkStr(ActorAttribute actor_attr, DBAtkGroupItem atk_item)
        {
            if (actor_attr == null || atk_item == null)
            {
                return("");
            }
            IActorAttribute value_1_data = actor_attr.GetAttr(atk_item.ItemArray[0].Id);
            IActorAttribute value_2_data = actor_attr.GetAttr(atk_item.ItemArray[1].Id);

            if (value_1_data == null && value_2_data == null)
            {
                return("");
            }
            long value_1 = 0;

            if (value_1_data != null)
            {
                value_1 = value_1_data.Value;
            }
            long value_2 = 0;

            if (value_2_data != null)
            {
                value_2 = value_2_data.Value;
            }
            return(GetGroupStr(value_1, value_2));
        }
示例#2
0
        protected override void ParseData(SqliteDataReader reader)
        {
            mInfos.Clear();
            mAtkGroupItemArray.Clear();
            DBAttrsItem info;

            if (reader != null)
            {
                if (reader.HasRows == true)
                {
                    while (reader.Read())
                    {
                        info = new DBAttrsItem();

                        info.Id       = DBTextResource.ParseUI_s(GetReaderString(reader, "id"), 0);
                        info.AtkGroup = DBTextResource.ParseUI_s(GetReaderString(reader, "atk_group"), 0);
                        info.Macro    = GetReaderString(reader, "macro");
                        mInfos.Add(info.Id, info);
                        if (info.AtkGroup != 0)
                        {
                            if (mAtkGroupItemArray.ContainsKey(info.AtkGroup) == false)
                            {
                                DBAtkGroupItem tmp = new DBAtkGroupItem();
                                tmp.GroupId   = info.AtkGroup;
                                tmp.ItemArray = new List <DBAttrsItem>();
                                mAtkGroupItemArray.Add(info.AtkGroup, tmp);
                            }
                            mAtkGroupItemArray[info.AtkGroup].ItemArray.Add(info);
                        }
                    }
                }
            }
            List <uint> removeGroupIdArray = new List <uint>();

            foreach (var item in mAtkGroupItemArray)
            {
                if (item.Value.ItemArray.Count != 2)
                {
                    removeGroupIdArray.Add(item.Key);
                }
            }

            for (int index = 0; index < removeGroupIdArray.Count; ++index)
            {
                mAtkGroupItemArray.Remove(removeGroupIdArray[index]);
            }
        }