コード例 #1
0
 public EquipmentInfo(DrawCardDropProto drawCardDropProto)
 {
     this.instanceID    = -1;
     this.equipmentData = EquipmentData.GetEquipmentDataByID(drawCardDropProto.no);
     LogNullEquipData(drawCardDropProto.no);
     this.strengthenLevel = 0;
 }
コード例 #2
0
 public EquipmentInfo(int instanceID, int equipmentDataID, int strengthenLevel)
 {
     this.instanceID    = instanceID;
     this.equipmentData = EquipmentData.GetEquipmentDataByID(equipmentDataID);
     LogNullEquipData(equipmentDataID);
     this.strengthenLevel = strengthenLevel;
 }
コード例 #3
0
        public EquipmentInfo(LuaTable equipmentInfoLuaTable)
        {
            this.instanceID = equipmentInfoLuaTable["id"].ToString().ToInt32();
            LuaTable equipDataLuaTable = (LuaTable)equipmentInfoLuaTable["data"];

            this.equipmentData = EquipmentData.GetEquipmentDataByID(equipDataLuaTable["id"].ToString().ToInt32());
            LogNullEquipData(equipDataLuaTable["id"].ToString().ToInt32());

            LuaTable attr1Table         = (LuaTable)equipmentInfoLuaTable.GetLuaFunction("GetTotalBaseAttr").Call(equipmentInfoLuaTable)[0];
            EquipmentAttributeType type = (EquipmentAttributeType)attr1Table["type"].ToString().ToInt32();

            _baseAttr = new EquipmentAttribute(type, attr1Table["value"].ToString().ToFloat());

            if (equipmentInfoLuaTable["randomAttrs"] != null)
            {
                _randomAttrs.Clear();
                LuaTable attr2Table = (LuaTable)equipmentInfoLuaTable["randomAttrs"];

                foreach (DictionaryEntry kvp in attr2Table.ToDictTable())
                {
                    LuaTable table = kvp.Value as LuaTable;
                    if (table != null)
                    {
                        type = (EquipmentAttributeType)table["type"].ToString().ToInt32();
                        _randomAttrs.Add(new EquipmentAttribute(type, table["value"].ToString().ToFloat()));
                    }
                }
            }
            _equipAttribute.Clear();
            _equipAttribute.Add(_baseAttr);
            for (int i = 0; i < _randomAttrs.Count; i++)
            {
                _equipAttribute.Add(_randomAttrs[i]);
            }
            this.ownerId = equipmentInfoLuaTable["ownerId"].ToString().ToInt32();
            this.star    = equipmentInfoLuaTable["star"].ToString().ToInt32();
        }