public virtual void UpdateSlot(byte index, byte lv) { var slot = user.Slots.Find(x => x.SlotIndex == index); user.SP -= ServerDefine.SlotLv2Price(slot.SlotLv); slot.SlotLv = lv; cubes.Where(x => x.gameCube.CubeId == slot.CubeId).ToList().ForEach(x => x.Lvup()); }
public override void Upsert(int index, GameSlot data) { base.Upsert(index, data); var cubeData = XmlKey.CubeData.Find <CubeDataXml.Data>(x => x.CubeId == data.CubeId); var price = ServerDefine.SlotLv2Price(data.SlotLv); cube_image.color = new Color(cubeData.Color[0], cubeData.Color[1], cubeData.Color[2]); lv_text.SetText(data.SlotLv.ToString()); sp_text.SetText(price.ToString()); }
public void Upsert(GameUser data) { base.Empty(); if (data == null) { return; } base.Upsert(); data.Slots.ForEach((x, i) => { slotComponents[i].Upsert(i, x); slotComponents[i].Lock(data.SP < ServerDefine.SlotLv2Price(x.SlotLv)); }); }