Beispiel #1
0
 public EquipmentInfo(EquipmentInfo info)
 {
     this.instanceID      = info.instanceID;
     this.equipmentData   = info.equipmentData;
     this.strengthenLevel = info.strengthenLevel;
     this.EquipAttribute  = new List <EquipmentAttribute>(info.EquipAttribute);
 }
Beispiel #2
0
 public EquipmentInfo(DrawCardDropProto drawCardDropProto)
 {
     this.instanceID    = -1;
     this.equipmentData = EquipmentData.GetEquipmentDataByID(drawCardDropProto.no);
     LogNullEquipData(drawCardDropProto.no);
     this.strengthenLevel = 0;
 }
Beispiel #3
0
 public EquipmentInfo(int instanceID, int equipmentDataID, int strengthenLevel)
 {
     this.instanceID    = instanceID;
     this.equipmentData = EquipmentData.GetEquipmentDataByID(equipmentDataID);
     LogNullEquipData(equipmentDataID);
     this.strengthenLevel = strengthenLevel;
 }
Beispiel #4
0
        public static EquipmentData GetEquipmentDataByID(int equipmentDataID)
        {
            EquipmentData equipmentData = null;

            if (EquipmentDataDictionary.ContainsKey(equipmentDataID))
            {
                equipmentData = EquipmentDataDictionary[equipmentDataID];
            }
            return(equipmentData);
        }
Beispiel #5
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();
        }
Beispiel #6
0
 public EquipmentInfo(int instanceID, EquipmentData equipmentData, int strengthenLevel)
 {
     this.instanceID      = instanceID;
     this.equipmentData   = equipmentData;
     this.strengthenLevel = strengthenLevel;
 }