// 判断能否进行法术攻击 public bool cardSkillAttack(DZPlayer user, stCardAttackMagicUserCmd rev) { SceneCardItem pAtt = getCardItemByThisID(rev.dwAttThisID); if (pAtt == null) { return(false); } if (!pAtt.isMagicCard() && !pAtt.isHeroMagicCard()) { (Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUIChat) as IUIChat).outMsg("释放技能失败 技能拥有者既不是法术 也不是英雄能力"); return(false); } if (!user.checkMp(pAtt.m_cardTableItem.m_magicConsume)) { (Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUIChat) as IUIChat).outMsg(string.Format("释放技能失败 这个技能需要你有{0}个法力水晶才可以", pAtt.m_cardTableItem.m_magicConsume)); return(false); } if (pAtt.m_cardTableItem.m_bNeedFaShuTarget > 0 && (rev.dwDefThisID == 0)) { (Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUIChat) as IUIChat).outMsg("释放技能失败 这个技能需要你手动选择一个目标"); return(false); } if (pAtt.isHeroMagicCard() && !pAtt.checkAttackTimes()) { (Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUIChat) as IUIChat).outMsg("释放技能失败 英雄能力每回合只能使用一次"); return(false); } return(true); }
// 删除一个消息 public void psstRetRemoveBattleCardUserCmd(stRetRemoveBattleCardUserCmd msg, int side, SceneCardItem sceneItem) { Ctx.m_instance.m_logSys.fightLog("[Fight] 接收到删除数据"); m_curParseRound.psstRetRemoveBattleCardUserCmd(msg, side, sceneItem); //nextOneAttactRound(); }
override public void psstRetRemoveBattleCardUserCmd(stRetRemoveBattleCardUserCmd msg, int side, SceneCardItem sceneItem) { m_msg = msg; m_side = side; m_sceneItem = sceneItem; m_card = Ctx.m_instance.m_sceneCardMgr.getCardByThisId(m_msg.dwThisID); m_card.setSvrDispose(); // 设置服务器死亡标志 }
protected void createCard(SceneCardItem sceneItem, SceneDZData sceneDZData) { if (m_showCard == null) { m_showCard = Ctx.m_instance.m_sceneCardMgr.createCard(sceneItem, sceneDZData); Ctx.m_instance.m_sceneCardMgr.remove(m_showCard); m_sceneCardItem = new SceneCardItem(); } }
// 判断能否进行正常攻击 public bool cardNormalAttack(DZPlayer user, stCardAttackMagicUserCmd rev) { SceneCardItem pAtt = getCardItemByThisID(rev.dwAttThisID); SceneCardItem pDef = getCardItemByThisID(rev.dwDefThisID); if (pDef == null || pAtt == null) { return(false); } if (pAtt == pDef) { (Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUIChat) as IUIChat).outMsg("普通攻击失败 怎么能自己打自己"); return(false); } if (pAtt.playerSide == pDef.playerSide) { (Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUIChat) as IUIChat).outMsg("普通攻击失败 普通攻击不能攻击自己的牌"); return(false); } if (pAtt.isFreeze()) { (Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUIChat) as IUIChat).outMsg("普通攻击失败 你自己处于冻结中无法攻击"); return(false); } if (!pDef.isHero() && !pDef.isAttend()) { (Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUIChat) as IUIChat).outMsg("普通攻击失败 你所攻击的对象既不是英雄也不是随从"); return(false); } if (!pDef.preAttackMe(pAtt, rev)) { (Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUIChat) as IUIChat).outMsg("普通攻击失败 攻击验证失败"); return(false); } if (!pAtt.hasDamage()) { (Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUIChat) as IUIChat).outMsg("普通攻击失败 你都没有攻击力 不能发起攻击"); return(false); } if (pDef.isSneak()) { (Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUIChat) as IUIChat).outMsg("普通攻击失败 普通攻击不能打到潜行单位"); return(false); } if (!pDef.isSneak()) //被攻击者隐形情况下,嘲讽无效 { if (Ctx.m_instance.m_dataPlayer.m_dzData.m_playerArr[(int)EnDZPlayer.ePlayerEnemy].checkTaunt() && !pDef.hasTaunt()) { (Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUIChat) as IUIChat).outMsg("普通攻击失败 你得攻击一个具有嘲讽的随从才行"); return(false); } } return(true); }
public void copyFrom(SceneCardItem rhv) { if (m_svrCard == null) { m_svrCard = new t_Card(); } m_svrCard.copyFrom(rhv.m_svrCard); m_cardTableItem = rhv.m_cardTableItem; m_playerSide = rhv.m_playerSide; m_cardArea = rhv.m_cardArea; }
public SceneCardItem createCardItemBySvrData(EnDZPlayer playerSide, t_Card mobject) { SceneCardItem sceneItem = null; sceneItem = new SceneCardItem(); sceneItem.svrCard = mobject; sceneItem.cardArea = (CardArea)mobject.pos.dwLocation; sceneItem.playerSide = playerSide; sceneItem.m_cardTableItem = Ctx.m_instance.m_tableSys.getItem(TableID.TABLE_CARD, mobject.dwObjectID).m_itemBody as TableCardItemBody; return sceneItem; }
public SceneCardItem createCardItemBySvrData(EnDZPlayer playerSide, t_Card mobject) { SceneCardItem sceneItem = null; sceneItem = new SceneCardItem(); sceneItem.svrCard = mobject; sceneItem.cardArea = (CardArea)mobject.pos.dwLocation; sceneItem.playerSide = playerSide; sceneItem.m_cardTableItem = Ctx.m_instance.m_tableSys.getItem(TableID.TABLE_CARD, mobject.dwObjectID).m_itemBody as TableCardItemBody; return(sceneItem); }
public bool removeOneSceneCardByThisID(uint thisid, ref SceneCardItem sceneItem) { foreach(SceneCardItem card in m_sceneCardList) { if(card.svrCard.qwThisID == thisid) { sceneItem = card; m_sceneCardList.Remove(card); return true; } } return false; }
public bool removeOneSceneCardByThisID(uint thisid, ref SceneCardItem sceneItem) { foreach (SceneCardItem card in m_sceneCardList) { if (card.svrCard.qwThisID == thisid) { sceneItem = card; m_sceneCardList.Remove(card); return(true); } } return(false); }
public bool preAttackMe(SceneCardItem pAtt, stCardAttackMagicUserCmd rev) { if (pAtt.isDie()) { return(false); } if (!pAtt.isAwake()) { return(false); } if (!pAtt.checkAttackTimes()) { return(false); } return(true); }
// 敌人发牌和自己发牌都走这里(除自己开始发牌到场景的 4 张牌),通过服务器卡牌数据添加卡牌 public void addCardByIdAndItem(uint objid, SceneCardItem sceneItem) { SceneCardBase tmpcard = null; if (SceneDZCV.BLACK_CARD_ID == objid) // 如果是 enemy 手牌,由于没有 m_sceneCardItem 数据,只能使用 id 创建 { tmpcard = Ctx.m_instance.m_sceneCardMgr.createCardById(objid, m_playerSide, CardArea.CARDCELLTYPE_HAND, CardType.CARDTYPE_ATTEND, m_sceneDZData); tmpcard.updateInitCardSceneInfo(m_sceneDZData.m_placeHolderGo.m_cardCenterGOArr[(int)m_playerSide, (int)CardArea.CARDCELLTYPE_NONE].transform); tmpcard.sceneCardBaseData.m_trackAniControl.startEnemyFaPaiAni(); // 播放动画 } else { tmpcard = Ctx.m_instance.m_sceneCardMgr.createCard(sceneItem, m_sceneDZData); tmpcard.updateInitCardSceneInfo(m_sceneDZData.m_placeHolderGo.m_cardCenterGOArr[(int)m_playerSide, (int)CardArea.CARDCELLTYPE_NONE].transform); tmpcard.sceneCardBaseData.m_trackAniControl.start2HandleAni(); // 播放动画 } addCard(tmpcard); tmpcard.sceneCardBaseData.m_trackAniControl.addEnterHandleEntryDisp(onOneCardEnterHandleEntry); }
public void getCardSideAndItemByThisID(uint thisID, ref int side, ref SceneCardItem retItem) { int idx = 0; while (idx < 2) { foreach (SceneCardItem item in m_playerArr[idx].sceneCardList) { if (item.svrCard.qwThisID == thisID) { retItem = item; side = idx; return; } } ++idx; } side = 2; // 说明没有查找到 }
// 通过服务器数据创建 public SceneCardBase createCard(SceneCardItem sceneItem, SceneDZData sceneDZData) { SceneCardBase ret = null; ret = createCardById(sceneItem.svrCard.dwObjectID, sceneItem.playerSide, sceneItem.cardArea, (CardType)sceneItem.m_cardTableItem.m_type, sceneDZData); ret.sceneCardItem = sceneItem; return ret; }
protected void testAni() { UISceneDZ uiDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI<UISceneDZ>(UISceneFormID.eUISceneDZ); // 测试[随从卡] m_aniModel = Ctx.m_instance.m_sceneCardMgr.createCardById(230000, EnDZPlayer.ePlayerSelf, CardArea.CARDCELLTYPE_HAND, CardType.CARDTYPE_ATTEND, uiDZ.m_sceneDZData); m_aniModel.setStartIdx(2); UtilApi.setPos(m_aniModel.transform(), new UnityEngine.Vector3(-4, 0, 0)); SceneCardItem sceneCardItem = null; sceneCardItem = new SceneCardItem(); sceneCardItem.svrCard = new t_Card(); sceneCardItem.svrCard.qwThisID = 0; sceneCardItem.svrCard.dwObjectID = 230000; sceneCardItem.m_cardTableItem = Ctx.m_instance.m_tableSys.getItem(TableID.TABLE_CARD, sceneCardItem.svrCard.dwObjectID).m_itemBody as TableCardItemBody; m_aniModel.sceneCardItem = sceneCardItem; m_aniModel.sceneCardBaseData.m_trackAniControl.faPai2MinAni(); }
override public void dispose() { // 从管理器中删除 Ctx.m_instance.m_sceneCardMgr.delObject(this); removeRef(); disposeBaseData(); m_render.dispose(); m_sceneCardItem = null; }
protected void testSkillFight() { UISceneDZ uiDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI<UISceneDZ>(UISceneFormID.eUISceneDZ); SceneCardBase selfCard = null; SceneCardBase enemyCard = null; // 测试[随从卡] selfCard = Ctx.m_instance.m_sceneCardMgr.createCardById(230000, EnDZPlayer.ePlayerSelf, CardArea.CARDCELLTYPE_HAND, CardType.CARDTYPE_ATTEND, uiDZ.m_sceneDZData); UtilApi.setPos(selfCard.transform(), new UnityEngine.Vector3(-4, 0, 0)); SceneCardItem sceneCardItem = null; sceneCardItem = new SceneCardItem(); sceneCardItem.svrCard = new t_Card(); sceneCardItem.svrCard.qwThisID = 0; sceneCardItem.svrCard.dwObjectID = 230000; sceneCardItem.m_cardTableItem = Ctx.m_instance.m_tableSys.getItem(TableID.TABLE_CARD, sceneCardItem.svrCard.dwObjectID).m_itemBody as TableCardItemBody; selfCard.sceneCardItem = sceneCardItem; enemyCard = Ctx.m_instance.m_sceneCardMgr.createCardById(230000, EnDZPlayer.ePlayerEnemy, CardArea.CARDCELLTYPE_HAND, CardType.CARDTYPE_ATTEND, uiDZ.m_sceneDZData); UtilApi.setPos(enemyCard.transform(), new UnityEngine.Vector3(4, 0, 0)); sceneCardItem = new SceneCardItem(); sceneCardItem.svrCard = new t_Card(); sceneCardItem.svrCard.qwThisID = 1; sceneCardItem.svrCard.dwObjectID = 230000; sceneCardItem.m_cardTableItem = Ctx.m_instance.m_tableSys.getItem(TableID.TABLE_CARD, sceneCardItem.svrCard.dwObjectID).m_itemBody as TableCardItemBody; enemyCard.sceneCardItem = sceneCardItem; // 技能攻击攻击特效在技能表中配置 AttackItemBase attItem = selfCard.fightData.attackData.createItem(EAttackType.eSkill); (attItem as SkillAttackItem).skillId = 3; (attItem as SkillAttackItem).hurtIdList.Add(1); attItem.damage = 10; // 受伤 HurtItemBase hurtItem = enemyCard.fightData.hurtData.createItem(EHurtType.eSkill); // 技能攻击没有被击特效 (hurtItem as SkillHurtItem).delayTime = (attItem as SkillAttackItem).skillTableItem.m_effectMoveTime; (hurtItem as SkillHurtItem).bDamage = true; hurtItem.damage = 20; }
public void testLinkEffect() { UISceneDZ uiDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI<UISceneDZ>(UISceneFormID.eUISceneDZ); // 测试[随从卡] m_linkEffectModel = Ctx.m_instance.m_sceneCardMgr.createCardById(230000, EnDZPlayer.ePlayerSelf, CardArea.CARDCELLTYPE_HAND, CardType.CARDTYPE_ATTEND, uiDZ.m_sceneDZData); UtilApi.setPos(m_linkEffectModel.transform(), new UnityEngine.Vector3(-4, 0, 0)); SceneCardItem sceneCardItem = null; sceneCardItem = new SceneCardItem(); sceneCardItem.svrCard = new t_Card(); sceneCardItem.svrCard.qwThisID = 0; sceneCardItem.svrCard.dwObjectID = 230000; sceneCardItem.m_cardTableItem = Ctx.m_instance.m_tableSys.getItem(TableID.TABLE_CARD, sceneCardItem.svrCard.dwObjectID).m_itemBody as TableCardItemBody; m_linkEffectModel.sceneCardItem = sceneCardItem; m_linkEffectModel.effectControl.addLinkEffect(4, true, true, true); }
public void addOneSceneCard(SceneCardItem card) { //m_sceneCardList.Add(card); m_sceneCardList.Insert(card.svrCard.pos.y, card); }
protected void testCommonFight() { UISceneDZ uiDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI<UISceneDZ>(UISceneFormID.eUISceneDZ); SceneCardBase selfCard = null; SceneCardBase enemyCard = null; // 测试[随从卡] selfCard = Ctx.m_instance.m_sceneCardMgr.createCardById(230000, EnDZPlayer.ePlayerSelf, CardArea.CARDCELLTYPE_HAND, CardType.CARDTYPE_ATTEND, uiDZ.m_sceneDZData); UtilApi.setPos(selfCard.transform(), new UnityEngine.Vector3(-4, 0, 0)); SceneCardItem sceneCardItem = null; sceneCardItem = new SceneCardItem(); sceneCardItem.svrCard = new t_Card(); sceneCardItem.svrCard.qwThisID = 0; sceneCardItem.svrCard.dwObjectID = 230000; sceneCardItem.m_cardTableItem = Ctx.m_instance.m_tableSys.getItem(TableID.TABLE_CARD, sceneCardItem.svrCard.dwObjectID).m_itemBody as TableCardItemBody; selfCard.sceneCardItem = sceneCardItem; enemyCard = Ctx.m_instance.m_sceneCardMgr.createCardById(230000, EnDZPlayer.ePlayerEnemy, CardArea.CARDCELLTYPE_HAND, CardType.CARDTYPE_ATTEND, uiDZ.m_sceneDZData); UtilApi.setPos(enemyCard.transform(), new UnityEngine.Vector3(4, 0, 0)); sceneCardItem = new SceneCardItem(); sceneCardItem.svrCard = new t_Card(); sceneCardItem.svrCard.qwThisID = 1; sceneCardItem.svrCard.dwObjectID = 230000; sceneCardItem.m_cardTableItem = Ctx.m_instance.m_tableSys.getItem(TableID.TABLE_CARD, sceneCardItem.svrCard.dwObjectID).m_itemBody as TableCardItemBody; enemyCard.sceneCardItem = sceneCardItem; AttackItemBase attItem = selfCard.fightData.attackData.createItem(EAttackType.eCommon); (attItem as ComAttackItem).hurterId = 1; (attItem as ComAttackItem).attackEffectId = 4; (attItem as ComAttackItem).moveTime = 2; attItem.damage = 10; // 受伤 HurtItemBase hurtItem = enemyCard.fightData.hurtData.createItem(EHurtType.eCommon); (hurtItem as ComHurtItem).hurtEffectId = 4; (hurtItem as ComHurtItem).delayTime = (attItem as ComAttackItem).getMoveTime(); hurtItem.damage = 20; }
// Enemy 卡牌改变位置 virtual public void changeEnemySceneCardArea(SceneCardItem sceneItem_) { SceneCardBase srcCard = Ctx.m_instance.m_sceneCardMgr.createCard(sceneItem_, m_sceneDZData); srcCard.convOutModel(); m_outSceneCardList.addCard(srcCard, sceneItem_.svrCard.pos.y); m_outSceneCardList.updateSceneCardPos(); srcCard.effectControl.updateStateEffect(); }
public bool removeAndDestroyCardByItem(SceneCardItem sceneCardItem) { bool bRet = false; int idx = 0; while (idx < m_sceneCardList.Count()) { // 这个地方删除的地方有时候会宕机, Enemy 自己手牌是没有 sceneCardItem 这个字段的 if (m_sceneCardList[idx] != null && m_sceneCardList[idx].sceneCardItem != null) { if (m_sceneCardList[idx].sceneCardItem.svrCard.qwThisID == sceneCardItem.svrCard.qwThisID) { //Ctx.m_instance.m_sceneCardMgr.removeAndDestroy(m_sceneCardList[idx]); //m_sceneCardList.RemoveAt(idx); m_sceneCardList[idx].dispose(); bRet = true; break; } } else { if(m_sceneCardList[idx] == null) { Ctx.m_instance.m_logSys.log("卡牌为空,卡牌详细信息"); } else if(m_sceneCardList[idx].sceneCardItem == null) { Ctx.m_instance.m_logSys.log(string.Format("卡牌 sceneCardItem 为 空,卡牌详细信息 {0}", m_sceneCardList[idx].getDesc())); } } ++idx; } return bRet; }
// side 删除的某一方的一个卡牌 public void psstRetRemoveBattleCardUserCmd(stRetRemoveBattleCardUserCmd cmd, int side, SceneCardItem sceneItem) { if ((int)EDeleteType.OP_ATTACK_DELETE == cmd.opType) // 攻击删除 { m_sceneDZData.m_fightMsgMgr.psstRetRemoveBattleCardUserCmd(cmd, side, sceneItem); } else if((int)EDeleteType.OP_FASHUCARD_DELETE == cmd.opType) // 法术牌攻击的时候,直接删除法术牌,然后从英雄处发出特效攻击 { Ctx.m_instance.m_logSys.fightLog(string.Format("[Fight] 法术攻击删除一张卡牌 id = {0}", sceneItem.svrCard.qwThisID)); m_sceneDZData.m_sceneDZAreaArr[side].removeAndDestroyOneCardByItem(sceneItem); } }
virtual public void psstRetRemoveBattleCardUserCmd(stRetRemoveBattleCardUserCmd msg, int side, SceneCardItem sceneItem) { }
public void setCardDataByIdx(int idx, SceneCardItem sceneItem) { if (idx < m_sceneCardList.Count()) // 这个地方有时候会超出范围 { m_sceneCardList[idx].sceneCardItem = sceneItem; } else { Ctx.m_instance.m_logSys.error("列表超出范围"); } }
public bool preAttackMe(SceneCardItem pAtt, stCardAttackMagicUserCmd rev) { if (pAtt.isDie()) { return false; } if (!pAtt.isAwake()) { return false; } if (!pAtt.checkAttackTimes()) { return false; } return true; }
// 移除一张卡牌,不释放资源,这个接口仅仅是客户端自己释放资源使用 public void removeOneCardByItem(SceneCardItem sceneItem) { if ((int)CardArea.CARDCELLTYPE_SKILL == sceneItem.svrCard.pos.dwLocation) { m_sceneSkillCard = null; } else if ((int)CardArea.CARDCELLTYPE_EQUIP == sceneItem.svrCard.pos.dwLocation) { m_sceneEquipCard = null; } else if ((int)CardArea.CARDCELLTYPE_COMMON == sceneItem.svrCard.pos.dwLocation) { m_outSceneCardList.removeCardIByItem(sceneItem); m_outSceneCardList.updateSceneCardPos(); } else if ((int)CardArea.CARDCELLTYPE_HAND == sceneItem.svrCard.pos.dwLocation) { if (m_inSceneCardList.removeCardIByItem(sceneItem)) { m_inSceneCardList.updateSceneCardPos(); } else // 可能是战吼或者法术有攻击目标的 { SceneCardBase srcCard = m_outSceneCardList.removeAndRetCardByItem(sceneItem); // 如果是法术或者战吼有攻击目标的卡牌,虽然在出牌区,但是是客户端自己移动过去的 if (srcCard != null && srcCard.canClientMove2OutArea()) { // 更新手牌索引 m_inSceneCardList.updateCardIndex(); } } } }
public SceneCardBase removeAndRetCardByItem(SceneCardItem sceneCardItem) { SceneCardBase retCard = null; int idx = 0; while (idx < m_sceneCardList.Count()) { if (m_sceneCardList[idx].sceneCardItem.svrCard.qwThisID == sceneCardItem.svrCard.qwThisID) { retCard = m_sceneCardList[idx]; //m_sceneCardList.RemoveAt(idx); removeCard(retCard); break; } ++idx; } return retCard; }
public void addSceneCardByItem(SceneCardItem sceneItem) { if (CardArea.CARDCELLTYPE_HERO == sceneItem.cardArea) { m_centerHero = Ctx.m_instance.m_sceneCardMgr.createCard(sceneItem, m_sceneDZData) as HeroCard; m_centerHero.setPlayerCareer((EnPlayerCareer)Ctx.m_instance.m_dataPlayer.m_dzData.m_playerArr[(int)m_playerSide].m_heroOccupation); // 设置 hero 动画结束后的处理 m_centerHero.heroAniEndDisp = m_sceneDZData.heroAniEndDisp; } else if (CardArea.CARDCELLTYPE_SKILL == sceneItem.cardArea) { m_sceneSkillCard = Ctx.m_instance.m_sceneCardMgr.createCard(sceneItem, m_sceneDZData); } else if (CardArea.CARDCELLTYPE_EQUIP == sceneItem.cardArea) { m_sceneEquipCard = Ctx.m_instance.m_sceneCardMgr.createCard(sceneItem, m_sceneDZData); } else if (CardArea.CARDCELLTYPE_HAND == sceneItem.cardArea) { if (Ctx.m_instance.m_dataPlayer.m_dzData.m_playerArr[(int)m_playerSide].m_recStartCardNum >= Ctx.m_instance.m_dataPlayer.m_dzData.m_playerArr[(int)m_playerSide].getStartCardNum()) // 判断接收的数据是否是 startCardList 列表中的数据 { m_inSceneCardList.addCardByIdAndItem(sceneItem.svrCard.dwObjectID, sceneItem); } else { m_inSceneCardList.setCardDataByIdx(Ctx.m_instance.m_dataPlayer.m_dzData.m_playerArr[(int)m_playerSide].m_recStartCardNum, sceneItem); ++Ctx.m_instance.m_dataPlayer.m_dzData.m_playerArr[(int)m_playerSide].m_recStartCardNum; } } else if (CardArea.CARDCELLTYPE_COMMON == sceneItem.cardArea) // 只有对方出牌的时候才会走这里 { changeEnemySceneCardArea(sceneItem); } }
public void removeOneSceneCard(SceneCardItem card) { m_sceneCardList.Remove(card); }
public bool ContainsByItem(SceneCardItem sceneCardItem) { bool bRet = false; int idx = 0; while (idx < m_sceneCardList.Count()) { if (m_sceneCardList[idx].sceneCardItem.svrCard.qwThisID == sceneCardItem.svrCard.qwThisID) { bRet = true; break; } ++idx; } return bRet; }
public SceneCardBase findCardIByItem(SceneCardItem sceneCardItem) { SceneCardBase retCard = null; int idx = 0; while (idx < m_sceneCardList.Count()) { if (m_sceneCardList[idx].sceneCardItem.svrCard.qwThisID == sceneCardItem.svrCard.qwThisID) { retCard = m_sceneCardList[idx]; break; } ++idx; } return retCard; }
// 通过服务器数据移除一张卡牌,并不释放 public bool removeCardIByItem(SceneCardItem sceneCardItem) { bool bRet = false; int idx = 0; while (idx < m_sceneCardList.Count()) { if (m_sceneCardList[idx].sceneCardItem.svrCard.qwThisID == sceneCardItem.svrCard.qwThisID) { //m_sceneCardList.RemoveAt(idx); removeCard(m_sceneCardList[idx]); bRet = true; break; } ++idx; } return bRet; }
public void updateCardData(SceneCardItem sceneItem) { foreach (SceneCardBase item in m_sceneCardList.list) { if (item.sceneCardItem.svrCard.qwThisID == sceneItem.svrCard.qwThisID) { item.updateCardDataChangeBySvr(); break; } } }
public void updateSceneCardByItem(SceneCardItem sceneItem) { if (CardArea.CARDCELLTYPE_HERO == sceneItem.cardArea) // 如果是 hero ,hero 自己已经创建显示了 { m_centerHero.updateCardDataChangeBySvr(); // 这个动画已经有了 } else if (CardArea.CARDCELLTYPE_SKILL == sceneItem.cardArea) { m_sceneSkillCard.updateCardDataChangeBySvr(); } else if (CardArea.CARDCELLTYPE_EQUIP == sceneItem.cardArea) { m_sceneEquipCard.updateCardDataChangeBySvr(); } else if (CardArea.CARDCELLTYPE_HAND == sceneItem.cardArea) { m_inSceneCardList.updateCardData(sceneItem); } else if (CardArea.CARDCELLTYPE_COMMON == sceneItem.cardArea) // 只有对方出牌的时候才会走这里 { m_outSceneCardList.updateCardData(sceneItem); } }