public void SetEmptyChipEquip(string userMonsterId) { GameWebAPI.RespDataCS_MonsterSlotInfoListLogic.SlotInfo slotInfo = new GameWebAPI.RespDataCS_MonsterSlotInfoListLogic.SlotInfo { userMonsterId = int.Parse(userMonsterId) }; this.monsterSlotInfo = new ChipClientSlotInfo(slotInfo); }
public static APIRequestTask RequestAPIChipFusion(int baseUserChipId, int[] materialChipIds, Action <int> onCompleted) { GameWebAPI.ChipFusionLogic chipFusionLogic = new GameWebAPI.ChipFusionLogic { SetSendData = delegate(GameWebAPI.ReqDataCS_ChipFusionLogic param) { param.baseChip = baseUserChipId; param.materialChip = materialChipIds; } }; APIRequestTask task = new APIRequestTask(chipFusionLogic, true); chipFusionLogic.OnReceived = delegate(GameWebAPI.RespDataCS_ChipFusionLogic resData) { if (resData.resultCode == 1) { List <GameWebAPI.RespDataCS_ChipListLogic.UserChipList> list = ChipDataMng.userChipData.userChipList.ToList <GameWebAPI.RespDataCS_ChipListLogic.UserChipList>(); int[] materialChipIds2 = materialChipIds; for (int i = 0; i < materialChipIds2.Length; i++) { int materialChip = materialChipIds2[i]; list.RemoveAll((GameWebAPI.RespDataCS_ChipListLogic.UserChipList c) => c.userChipId == materialChip); } ChipDataMng.userChipData.userChipList = list.ToArray(); GameWebAPI.RespDataCS_ChipListLogic.UserChipList userChipInfo = ChipDataMng.GetUserChip(baseUserChipId); userChipInfo.chipId = resData.userChip.chipId; if (userChipInfo.userMonsterId != 0) { ChipClientSlotInfo slotInfo = ChipDataMng.userChipSlotData.GetSlotInfo(userChipInfo.userMonsterId.ToString()); ChipClientEquip chipClientEquip = slotInfo.FindChipEquip(baseUserChipId); chipClientEquip.chipId = resData.userChip.chipId; TaskBase task = task; GameWebAPI.RequestMonsterList requestMonsterList = new GameWebAPI.RequestMonsterList(); requestMonsterList.SetSendData = delegate(GameWebAPI.ReqDataUS_GetMonsterList param) { param.userMonsterIds = new int[] { userChipInfo.userMonsterId }; }; requestMonsterList.OnReceived = delegate(GameWebAPI.RespDataUS_GetMonsterList response) { ClassSingleton <MonsterUserDataMng> .Instance.UpdateUserMonsterData(response.userMonsterList); }; task.Add(new APIRequestTask(requestMonsterList, true)); } } onCompleted(resData.resultCode); }; return(task); }
public void SetChipIdList(int[] idList) { if (idList == null) { return; } if (this.monsterSlotInfo == null) { this.monsterSlotInfo = new ChipClientSlotInfo(new GameWebAPI.RespDataCS_MonsterSlotInfoListLogic.SlotInfo()); } else { this.monsterSlotInfo.DeleteAllChipEquip(); } for (int i = 0; i < idList.Length; i++) { if (0 < idList[i]) { this.monsterSlotInfo.AddChipEquip(new ChipClientEquip(idList[i])); } } }
public static GameWebAPI.ChipUnlockExtraSlotLogic RequestAPIChipUnlockExtraSlot(MonsterData md, int dispNum, int useEjectItemCnt, Action <int> callBack = null) { return(new GameWebAPI.ChipUnlockExtraSlotLogic { SetSendData = delegate(GameWebAPI.ReqDataCS_ChipUnlockExtraSlotLogic param) { param.dispNum = dispNum; param.userMonsterId = int.Parse(md.userMonster.userMonsterId); }, OnReceived = delegate(GameWebAPI.RespDataCS_ChipUnlockExtraSlotLogic resData) { if (resData.resultCode == 1) { ChipClientSlotInfo slotInfo = ChipDataMng.userChipSlotData.GetSlotInfo(md.userMonster.userMonsterId); slotInfo.GetSlotNum().extraSlotNum++; Singleton <UserDataMng> .Instance.UpdateUserItemNum(6, useEjectItemCnt * -1); } if (callBack != null) { callBack(resData.resultCode); } } }); }
public void SetChipEquip(string userMonsterId) { this.monsterSlotInfo = ChipDataMng.GetUserChipSlotData().GetSlotInfo(userMonsterId); }