重构战斗资源加载 , 新添加宠物

This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2023-12-07 02:14:18 +08:00
parent 1dbbc6c79b
commit 931f580082
257 changed files with 15654 additions and 348 deletions

View File

@@ -70,9 +70,9 @@ export class TbGRole {
*/
readonly roleName: string
/**
* 描述
* 角色Spine资源Id
*/
readonly spine: string
readonly spine: number
/**
* 角色技能Id列表
*/
@@ -123,45 +123,6 @@ export class TbGRoleAttack {
}
export namespace TB {
export class TbGRoleBattleRes {
constructor(_json_: any) {
if (_json_.id === undefined) { throw new Error() }
this.id = _json_.id
if (_json_.resName === undefined) { throw new Error() }
this.resName = _json_.resName
if (_json_.resType === undefined) { throw new Error() }
this.resType = _json_.resType
if (_json_.resSrc === undefined) { throw new Error() }
this.resSrc = _json_.resSrc
}
/**
* id
*/
readonly id: number
/**
* 资源名称
*/
readonly resName: string
/**
* 资源类型
*/
readonly resType: string
/**
* 资源地址
*/
readonly resSrc: string
resolve(tables:Tables)
{
}
}
}
export namespace TB {
export class TbGRoleSkill {
@@ -242,15 +203,15 @@ export class TbGMap {
/**
* 地图1(前)
*/
readonly map1: string
readonly map1: number
/**
* 地图2(后)
*/
readonly map2: string
readonly map2: number
/**
* 地图3(天空)
*/
readonly map3: string
readonly map3: number
/**
* 地图1(前) 偏移量Y
*/
@@ -696,6 +657,8 @@ export class TbBattleResource {
constructor(_json_: any) {
if (_json_.id === undefined) { throw new Error() }
this.id = _json_.id
if (_json_.name === undefined) { throw new Error() }
this.name = _json_.name
if (_json_.path === undefined) { throw new Error() }
this.path = _json_.path
if (_json_.type === undefined) { throw new Error() }
@@ -706,12 +669,16 @@ export class TbBattleResource {
* id
*/
readonly id: number
/**
* 资源介绍
*/
readonly name: string
/**
* 资源路径
*/
readonly path: string
/**
* 资源类型(0.Spine)
* 资源类型(0.Spine,1.Sprite)
*/
readonly type: number
@@ -821,38 +788,6 @@ export class TbGRoleAttack{
export class TbGRoleBattleRes{
private _dataMap: Map<number, TB.TbGRoleBattleRes>
private _dataList: TB.TbGRoleBattleRes[]
constructor(_json_: any) {
this._dataMap = new Map<number, TB.TbGRoleBattleRes>()
this._dataList = []
for(var _json2_ of _json_) {
let _v: TB.TbGRoleBattleRes
_v = new TB.TbGRoleBattleRes(_json2_)
this._dataList.push(_v)
this._dataMap.set(_v.id, _v)
}
}
getDataMap(): Map<number, TB.TbGRoleBattleRes> { return this._dataMap; }
getDataList(): TB.TbGRoleBattleRes[] { return this._dataList; }
get(key: number): TB.TbGRoleBattleRes | undefined { return this._dataMap.get(key); }
resolve(tables:Tables)
{
for(let data of this._dataList)
{
data.resolve(tables)
}
}
}
export class TbGRoleSkill{
private _dataMap: Map<number, TB.TbGRoleSkill>
private _dataList: TB.TbGRoleSkill[]
@@ -1278,8 +1213,6 @@ export class Tables {
get TbGRole(): TbGRole { return this._TbGRole;}
private _TbGRoleAttack: TbGRoleAttack
get TbGRoleAttack(): TbGRoleAttack { return this._TbGRoleAttack;}
private _TbGRoleBattleRes: TbGRoleBattleRes
get TbGRoleBattleRes(): TbGRoleBattleRes { return this._TbGRoleBattleRes;}
private _TbGRoleSkill: TbGRoleSkill
get TbGRoleSkill(): TbGRoleSkill { return this._TbGRoleSkill;}
private _TbGMap: TbGMap
@@ -1311,7 +1244,6 @@ export class Tables {
this._TbGGlobal = new TbGGlobal(loader('tbgglobal'))
this._TbGRole = new TbGRole(loader('tbgrole'))
this._TbGRoleAttack = new TbGRoleAttack(loader('tbgroleattack'))
this._TbGRoleBattleRes = new TbGRoleBattleRes(loader('tbgrolebattleres'))
this._TbGRoleSkill = new TbGRoleSkill(loader('tbgroleskill'))
this._TbGMap = new TbGMap(loader('tbgmap'))
this._TbGOnHookGlobal = new TbGOnHookGlobal(loader('tbgonhookglobal'))
@@ -1329,7 +1261,6 @@ export class Tables {
this._TbGGlobal.resolve(this)
this._TbGRole.resolve(this)
this._TbGRoleAttack.resolve(this)
this._TbGRoleBattleRes.resolve(this)
this._TbGRoleSkill.resolve(this)
this._TbGMap.resolve(this)
this._TbGOnHookGlobal.resolve(this)