Files
18xchat/assets/Scripts/schema/schema.ts
T

735 lines
14 KiB
TypeScript

//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
import ByteBuf from '../luban/ByteBuf'
export enum Category {
/**
* 熟女
*/
shunv = 0,
/**
* 18岁
*/
eighteen = 1,
/**
* 辣妈
*/
lama = 2,
/**
* 捆绑
*/
kunbang = 3,
/**
* 公众野战
*/
publicfight = 4,
/**
* 卡通
*/
cartoon = 5,
/**
* 未完成
*/
upcomming = 6,
}
export enum PriceType {
/**
* 免费
*/
free = 0,
/**
* 试用
*/
first_time_free = 1,
/**
* 收费
*/
pay = 2,
}
export class AiCharacter {
constructor(_buf_: ByteBuf) {
this.id = _buf_.readInt()
this.systemInstruction = _buf_.readString()
}
/**
* 角色id
*/
readonly id: number
/**
* 系统指令
*/
readonly systemInstruction: string
resolve(tables:Tables) {
}
}
export class Girl {
constructor(_buf_: ByteBuf) {
this.id = _buf_.readInt()
this.nameKey = _buf_.readString()
this.age = _buf_.readString()
this.category = _buf_.readInt()
this.tagKey = _buf_.readString()
this.priceType = _buf_.readInt()
this.avatarPath = _buf_.readString()
this.starCount = _buf_.readInt()
}
/**
* id
*/
readonly id: number
/**
* 名字键
*/
readonly nameKey: string
/**
* 年龄
*/
readonly age: string
/**
* 分类
*/
readonly category: Category
/**
* 标签键
*/
readonly tagKey: string
/**
* 付费类型
*/
readonly priceType: PriceType
/**
* 头像路径
*/
readonly avatarPath: string
/**
* 评价星数
*/
readonly starCount: number
resolve(tables:Tables) {
}
}
export class GirlDetail {
constructor(_buf_: ByteBuf) {
this.id = _buf_.readInt()
this.detailDesc = _buf_.readString()
{ let n = Math.min(_buf_.readSize(), _buf_.size); this.pics = []; for(let i = 0 ; i < n ; i++) { let _e0 ;_e0 = _buf_.readString(); this.pics.push(_e0);}}
}
/**
* id
*/
readonly id: number
/**
* 自我介绍
*/
readonly detailDesc: string
/**
* 资源列表
*/
readonly pics: string[]
resolve(tables:Tables) {
}
}
export class GlobalConfig {
constructor(_buf_: ByteBuf) {
this.ApiKey = _buf_.readString()
this.Model = _buf_.readString()
this.Temperature = _buf_.readFloat()
this.MaxTokens = _buf_.readInt()
this.Timeout = _buf_.readInt()
this.FreeChatTimes = _buf_.readInt()
this.GameName = _buf_.readString()
}
/**
* api键
*/
readonly ApiKey: string
/**
* ai模型
*/
readonly Model: string
readonly Temperature: number
/**
* 单次聊天最大token
*/
readonly MaxTokens: number
/**
* 超时时间(微秒)
*/
readonly Timeout: number
/**
* 单个角色免费聊天次数
*/
readonly FreeChatTimes: number
/**
* 游戏名
*/
readonly GameName: string
resolve(tables:Tables) {
}
}
export class Language {
constructor(_buf_: ByteBuf) {
this.key = _buf_.readString()
this.languageEn = _buf_.readString()
this.languageCn = _buf_.readString()
this.languageHi = _buf_.readString()
this.languageFr = _buf_.readString()
this.languageDe = _buf_.readString()
}
/**
* key
*/
readonly key: string
readonly languageEn: string
readonly languageCn: string
/**
* 印地语翻译
*/
readonly languageHi: string
/**
* 法语翻译
*/
readonly languageFr: string
/**
* 德语翻译
*/
readonly languageDe: string
resolve(tables:Tables) {
}
}
export class PurchaseConfig {
constructor(_buf_: ByteBuf) {
this.id = _buf_.readInt()
this.name = _buf_.readString()
this.desc = _buf_.readString()
this.count = _buf_.readInt()
}
/**
* 商品id
*/
readonly id: number
/**
* 名称
*/
readonly name: string
/**
* 数量
*/
readonly desc: string
/**
* 计费点ID
*/
readonly count: number
resolve(tables:Tables) {
}
}
export class Theme {
constructor(_buf_: ByteBuf) {
this.id = _buf_.readInt()
this.key = _buf_.readString()
this.name = _buf_.readString()
this.category = _buf_.readInt()
this.isRelease = _buf_.readBool()
this.path = _buf_.readString()
}
/**
* id
*/
readonly id: number
/**
* 多语言键
*/
readonly key: string
/**
* 主题名称
*/
readonly name: string
/**
* 主题枚举
*/
readonly category: Category
/**
* 是否解锁
*/
readonly isRelease: boolean
/**
* 图片路径
*/
readonly path: string
resolve(tables:Tables) {
}
}
export class vector2 {
constructor(_buf_: ByteBuf) {
this.x = _buf_.readFloat()
this.y = _buf_.readFloat()
}
readonly x: number
readonly y: number
resolve(tables:Tables) {
}
}
export class vector3 {
constructor(_buf_: ByteBuf) {
this.x = _buf_.readFloat()
this.y = _buf_.readFloat()
this.z = _buf_.readFloat()
}
readonly x: number
readonly y: number
readonly z: number
resolve(tables:Tables) {
}
}
export class vector4 {
constructor(_buf_: ByteBuf) {
this.x = _buf_.readFloat()
this.y = _buf_.readFloat()
this.z = _buf_.readFloat()
this.w = _buf_.readFloat()
}
readonly x: number
readonly y: number
readonly z: number
readonly w: number
resolve(tables:Tables) {
}
}
export class TbLanguage {
private _dataMap: Map<string, Language>
private _dataList: Language[]
constructor(_buf_: ByteBuf) {
this._dataMap = new Map<string, Language>()
this._dataList = []
for(let n = _buf_.readInt(); n > 0; n--) {
let _v: Language
_v = new Language(_buf_)
this._dataList.push(_v)
this._dataMap.set(_v.key, _v)
}
}
getDataMap(): Map<string, Language> { return this._dataMap; }
getDataList(): Language[] { return this._dataList; }
get(key: string): Language | undefined {
return this._dataMap.get(key);
}
resolve(tables:Tables) {
for(let data of this._dataList)
{
data.resolve(tables)
}
}
}
export class TbGirls {
private _dataMap: Map<number, Girl>
private _dataList: Girl[]
constructor(_buf_: ByteBuf) {
this._dataMap = new Map<number, Girl>()
this._dataList = []
for(let n = _buf_.readInt(); n > 0; n--) {
let _v: Girl
_v = new Girl(_buf_)
this._dataList.push(_v)
this._dataMap.set(_v.id, _v)
}
}
getDataMap(): Map<number, Girl> { return this._dataMap; }
getDataList(): Girl[] { return this._dataList; }
get(key: number): Girl | undefined {
return this._dataMap.get(key);
}
resolve(tables:Tables) {
for(let data of this._dataList)
{
data.resolve(tables)
}
}
}
export class TbGirlsDetail {
private _dataMap: Map<number, GirlDetail>
private _dataList: GirlDetail[]
constructor(_buf_: ByteBuf) {
this._dataMap = new Map<number, GirlDetail>()
this._dataList = []
for(let n = _buf_.readInt(); n > 0; n--) {
let _v: GirlDetail
_v = new GirlDetail(_buf_)
this._dataList.push(_v)
this._dataMap.set(_v.id, _v)
}
}
getDataMap(): Map<number, GirlDetail> { return this._dataMap; }
getDataList(): GirlDetail[] { return this._dataList; }
get(key: number): GirlDetail | undefined {
return this._dataMap.get(key);
}
resolve(tables:Tables) {
for(let data of this._dataList)
{
data.resolve(tables)
}
}
}
export class TbThemes {
private _dataMap: Map<number, Theme>
private _dataList: Theme[]
constructor(_buf_: ByteBuf) {
this._dataMap = new Map<number, Theme>()
this._dataList = []
for(let n = _buf_.readInt(); n > 0; n--) {
let _v: Theme
_v = new Theme(_buf_)
this._dataList.push(_v)
this._dataMap.set(_v.id, _v)
}
}
getDataMap(): Map<number, Theme> { return this._dataMap; }
getDataList(): Theme[] { return this._dataList; }
get(key: number): Theme | undefined {
return this._dataMap.get(key);
}
resolve(tables:Tables) {
for(let data of this._dataList)
{
data.resolve(tables)
}
}
}
export class TbAiCharacters {
private _dataMap: Map<number, AiCharacter>
private _dataList: AiCharacter[]
constructor(_buf_: ByteBuf) {
this._dataMap = new Map<number, AiCharacter>()
this._dataList = []
for(let n = _buf_.readInt(); n > 0; n--) {
let _v: AiCharacter
_v = new AiCharacter(_buf_)
this._dataList.push(_v)
this._dataMap.set(_v.id, _v)
}
}
getDataMap(): Map<number, AiCharacter> { return this._dataMap; }
getDataList(): AiCharacter[] { return this._dataList; }
get(key: number): AiCharacter | undefined {
return this._dataMap.get(key);
}
resolve(tables:Tables) {
for(let data of this._dataList)
{
data.resolve(tables)
}
}
}
export class TbGlobalConfig {
private _data: GlobalConfig
constructor(_buf_: ByteBuf) {
if (_buf_.readInt() != 1) throw new Error('table mode=one, but size != 1')
this._data = new GlobalConfig(_buf_)
}
getData(): GlobalConfig { return this._data; }
/**
* api键
*/
get ApiKey(): string { return this._data.ApiKey; }
/**
* ai模型
*/
get Model(): string { return this._data.Model; }
get Temperature(): number { return this._data.Temperature; }
/**
* 单次聊天最大token
*/
get MaxTokens(): number { return this._data.MaxTokens; }
/**
* 超时时间(微秒)
*/
get Timeout(): number { return this._data.Timeout; }
/**
* 单个角色免费聊天次数
*/
get FreeChatTimes(): number { return this._data.FreeChatTimes; }
/**
* 游戏名
*/
get GameName(): string { return this._data.GameName; }
resolve(tables:Tables) {
this._data.resolve(tables)
}
}
export class TbPurchaseConfig {
private _dataMap: Map<number, PurchaseConfig>
private _dataList: PurchaseConfig[]
constructor(_buf_: ByteBuf) {
this._dataMap = new Map<number, PurchaseConfig>()
this._dataList = []
for(let n = _buf_.readInt(); n > 0; n--) {
let _v: PurchaseConfig
_v = new PurchaseConfig(_buf_)
this._dataList.push(_v)
this._dataMap.set(_v.id, _v)
}
}
getDataMap(): Map<number, PurchaseConfig> { return this._dataMap; }
getDataList(): PurchaseConfig[] { return this._dataList; }
get(key: number): PurchaseConfig | undefined {
return this._dataMap.get(key);
}
resolve(tables:Tables) {
for(let data of this._dataList)
{
data.resolve(tables)
}
}
}
type ByteBufLoader = (file: string) => ByteBuf
export class Tables {
private _TbLanguage: TbLanguage
get TbLanguage(): TbLanguage { return this._TbLanguage;}
private _TbGirls: TbGirls
get TbGirls(): TbGirls { return this._TbGirls;}
private _TbGirlsDetail: TbGirlsDetail
get TbGirlsDetail(): TbGirlsDetail { return this._TbGirlsDetail;}
private _TbThemes: TbThemes
get TbThemes(): TbThemes { return this._TbThemes;}
private _TbAiCharacters: TbAiCharacters
get TbAiCharacters(): TbAiCharacters { return this._TbAiCharacters;}
private _TbGlobalConfig: TbGlobalConfig
get TbGlobalConfig(): TbGlobalConfig { return this._TbGlobalConfig;}
private _TbPurchaseConfig: TbPurchaseConfig
get TbPurchaseConfig(): TbPurchaseConfig { return this._TbPurchaseConfig;}
static getTableNames(): string[] {
let names: string[] = [];
names.push('tblanguage');
names.push('tbgirls');
names.push('tbgirlsdetail');
names.push('tbthemes');
names.push('tbaicharacters');
names.push('tbglobalconfig');
names.push('tbpurchaseconfig');
return names;
}
constructor(loader: ByteBufLoader) {
this._TbLanguage = new TbLanguage(loader('tblanguage'))
this._TbGirls = new TbGirls(loader('tbgirls'))
this._TbGirlsDetail = new TbGirlsDetail(loader('tbgirlsdetail'))
this._TbThemes = new TbThemes(loader('tbthemes'))
this._TbAiCharacters = new TbAiCharacters(loader('tbaicharacters'))
this._TbGlobalConfig = new TbGlobalConfig(loader('tbglobalconfig'))
this._TbPurchaseConfig = new TbPurchaseConfig(loader('tbpurchaseconfig'))
this._TbLanguage.resolve(this)
this._TbGirls.resolve(this)
this._TbGirlsDetail.resolve(this)
this._TbThemes.resolve(this)
this._TbAiCharacters.resolve(this)
this._TbGlobalConfig.resolve(this)
this._TbPurchaseConfig.resolve(this)
}
}