// 执行队列中的一个 Item public void getNextItem() { if (m_curAttackItem == null && m_attackList.Count() > 0) { m_curAttackItem = m_attackList[0]; } }
// 生成攻击数据,普通攻击 def 是有值的,技能攻击没有值 protected void startAtt(SceneCardBase att, SceneCardBase def, EAttackType attackType, stNotifyBattleCardPropertyUserCmd msg) { if (att != null) { Ctx.m_instance.m_logSys.fightLog(string.Format("[Fight] 攻击者详细信息 {0}", att.getDesc())); // 攻击 AttackItemBase attItem = null; attItem = att.fightData.attackData.createItem(attackType); attItem.initItemData(att, def, msg); } }
public AttackItemBase createItem(EAttackType type) { AttackItemBase ret = null; if (EAttackType.eCommon == type) { ret = new ComAttackItem(type); } else if (EAttackType.eSkill == type) { ret = new SkillAttackItem(type); } m_attackList.Add(ret); return(ret); }
public void removeItem(AttackItemBase item) { m_attackList.Remove(item); item.dispose(); }
// 执行队列中的一个 Item public void endCurItem() { m_curAttackItem.attackEndDisp.dispatchEvent(m_curAttackItem); removeItem(m_curAttackItem); m_curAttackItem = null; }
public void addItem(AttackItemBase item) { m_attackList.Add(item); }