获取所有已经解锁技师的 id

This commit is contained in:
chen wei bo
2025-09-20 15:52:41 +08:00
parent b3a6fa280d
commit 57be5b461d
+29
View File
@@ -9,6 +9,7 @@ import { GirlChatData } from "./GirlChatData";
import { GirlFavorabilityData } from "./GirlFavorabilityData";
import { DataId } from "./DataManager";
import proto from "db://assets/Scripts/proto/proto.pb.js";
import { PriceType } from "../../schema/schema";
// 分类的数据结构
interface CategoryBucket {
@@ -218,6 +219,18 @@ export class GirlData extends BaseData {
return oneData.getGrilPriceType();
}
/** 技师是否免费类型 */
public isGirlFreeType(categoryId: string, girlId: number): boolean {
let priceType = this.getGrilPriceType(categoryId, girlId);
return priceType == PriceType.free;
}
/** 技师是否付费类型 */
public isGirlPayType(categoryId: string, girlId: number): boolean {
let priceType = this.getGrilPriceType(categoryId, girlId);
return priceType == PriceType.pay;
}
/** 获取原来的价格,除100 */
public getGrilOriginalPrice(categoryId: string, girlId: number): number {
let oneData = this.getGrilBrief(categoryId, girlId);
@@ -755,6 +768,22 @@ export class GirlData extends BaseData {
return oneData.getUnlockedVideoIds();
}
/** 获取所有已经解锁技师的 id,不区分技师的付费类型 */
public getAllReleaseGirlIds(): number[] {
const result: number[] = [];
const cats = this.ensureCategories();
for (const [categoryId, bucket] of cats.entries()) {
for (const girlId of bucket.girlIds) {
if (this.getIsRelease(categoryId, girlId)) {
result.push(girlId);
}
}
}
// 返回结果
return result;
}
/** --------------------------------------------------------- 技师的聊天数据 --------------------------------------------------------- */
// 解析技师聊天数据,一个