refactor: 统一将 pool_lv 重命名为 card_lv 并清理废弃代码
本次提交完成了全项目范围内的术语统一重构: 1. 将所有`pool_lv`相关变量、字段、注释替换为`card_lv`,对齐卡牌等级的业务含义 2. 移除了配置中冗余的默认`pool_lv`赋值,简化数据结构 3. 删除了废弃的`HlistComp.ts`组件及其元文件 4. 修正了多处逻辑错误,确保卡牌等级正确驱动背景框切换 5. 更新了相关注释和文档,保持代码一致性
This commit is contained in:
@@ -115,10 +115,10 @@ export class CardLiteComp extends CCComp {
|
||||
* 便捷方法:通过英雄 UUID 和卡池等级直接设置英雄卡。
|
||||
* 自动从 CardPoolList 查找匹配的卡牌配置。
|
||||
* @param uuid 英雄 UUID
|
||||
* @param poolLv 卡池等级(默认 1)
|
||||
* @param cardLv 卡牌等级(默认 1)
|
||||
*/
|
||||
setHeroByUuid(uuid: number, poolLv: number = 1) {
|
||||
const card = CardPoolList.find(c => c.uuid === uuid && c.pool_lv === poolLv);
|
||||
setHeroByUuid(uuid: number, cardLv: number = 1) {
|
||||
const card = CardPoolList.find(c => c.uuid === uuid && c.card_lv === cardLv);
|
||||
if (card) {
|
||||
this.setData(card);
|
||||
return;
|
||||
@@ -130,7 +130,7 @@ export class CardLiteComp extends CCComp {
|
||||
type: CardType.Hero,
|
||||
cost: 5,
|
||||
weight: 25,
|
||||
pool_lv: poolLv as any,
|
||||
card_lv: cardLv,
|
||||
kind: CKind.Hero,
|
||||
hero_lv: hero.lv || 1
|
||||
});
|
||||
@@ -194,7 +194,7 @@ export class CardLiteComp extends CCComp {
|
||||
* 2. 技能卡:显示技能名、静态图标。
|
||||
* 3. 特殊卡:显示卡名、静态图标。
|
||||
*
|
||||
* 同时根据 pool_lv 切换背景底框,根据 kind 切换种类标识。
|
||||
* 同时根据 card_lv 切换背景底框,根据 kind 切换种类标识。
|
||||
*/
|
||||
private applyCardUI() {
|
||||
if (!this.cardData) {
|
||||
@@ -221,7 +221,7 @@ export class CardLiteComp extends CCComp {
|
||||
const kindName = CKind[this.cardData.kind];
|
||||
|
||||
if (this.BG_node) {
|
||||
const bgLv = this.cardData.base_pool_lv ?? this.cardData.pool_lv;
|
||||
const bgLv = this.cardData.base_card_lv ?? this.cardData.card_lv;
|
||||
this.BG_node.children.forEach(child => {
|
||||
child.active = (child.name === kindName);
|
||||
const bg = child.getComponent(CardBgComp);
|
||||
|
||||
Reference in New Issue
Block a user