diff --git a/.creator/default-meta.json b/.creator/default-meta.json index abb1239..7bbbd06 100644 --- a/.creator/default-meta.json +++ b/.creator/default-meta.json @@ -1,5 +1,5 @@ { "image": { - "type": "sprite-frame" + "type": "texture" } } diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..9b6a89f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,5 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf \ No newline at end of file diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..5af3681 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,11 @@ +.creator +.idea +.vscode +.git +.DS_Store +/node_modules +/build +/temp +/library +/profiles +/settings \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..5af3681 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,11 @@ +.creator +.idea +.vscode +.git +.DS_Store +/node_modules +/build +/temp +/library +/profiles +/settings \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..f59a508 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,6 @@ +{ + "printWidth": 100, + "singleQuote": true, + "semi": false, + "endOfLine": "lf" +} diff --git a/assets/FishSingle/fish/script/FishMover.ts b/assets/FishSingle/fish/script/FishMover.ts index 01c3ee7..2bf7237 100644 --- a/assets/FishSingle/fish/script/FishMover.ts +++ b/assets/FishSingle/fish/script/FishMover.ts @@ -1,162 +1,164 @@ import { - _decorator, - Component, - CCInteger, - CCFloat, - Vec2, - Animation, - Vec3, + _decorator, + Component, + CCInteger, + CCFloat, + Vec2, + Animation, + Vec3, } from 'cc' -const { ccclass, property } = _decorator + +const {ccclass, property} = _decorator import FishBase from './FishBase' import MathUtils from '../../script/engine/utils/MathUtils' -import { Logger } from '../../script/engine/utils/Logger' +import {Logger} from '../../script/engine/utils/Logger' import TimeHelper from '../../script/game/utils/TimeHelper' @ccclass('FishMover') export default class FishMover extends Component { - // //鱼类型 - @property({ type: CCInteger }) - public fishType: number = 1 - // //鱼移动速度 - @property({ type: CCFloat }) - public speed: number = 3 - // //下个位置移动点 - private targetMoveIndex: number = 0 - // //鱼移动位置 - public movePList: Array = [] - // //贝萨尔曲线 - public bezierPList: Array = [] - public isMoving: boolean = false - private minSpeed: number = 0.1 - private moveCount: number = 1 - private totalTimes: number = 60 * 2 - private _vec3Cahce: Vec3 = new Vec3() - public startMove() { - this.targetMoveIndex = 0 - this.isMoving = true - //this.node.getComponent(Animation).play()//v3 当前帧 不能播放 - TimeHelper.exeNextFrame(this.node, () => - this.node.getComponent(Animation).play() - ) - } + //鱼类型 + @property({type: CCInteger}) + public fishType: number = 1 + //鱼移动速度 + @property({type: CCFloat}) + public speed: number = 3 + //下个位置移动点 + private targetMoveIndex: number = 0 + //鱼移动位置 + public movePList: Array = [] + //贝萨尔曲线 + public bezierPList: Array = [] + public isMoving: boolean = false + private minSpeed: number = 0.1 + private moveCount: number = 1 + private totalTimes: number = 60 * 2 + private _vec3Cahce: Vec3 = new Vec3() - update(dt) { - // this.moveFish(); - this.checkMoveBezier() - } + public startMove() { + this.targetMoveIndex = 0 + this.isMoving = true + //this.node.getComponent(Animation).play()//v3 当前帧 不能播放 + TimeHelper.exeNextFrame(this.node, () => + this.node.getComponent(Animation).play() + ) + } - private checkMoveBezier() { - if (this.isMoving && !this.getComponent(FishBase).isDead) { - this.moveCount++ - if (this.moveCount >= this.totalTimes) { - this.moveCount = this.totalTimes - } - this.moveBezier() - } - } + update(dt) { + // this.moveFish(); + this.checkMoveBezier() + } - public moveBezier() { - // [warn] [[-632,-230],[-444,-117],[-264,-242]] - // let p0: cc.Vec2 = cc.v2(-632, -230) - // let p1: cc.Vec2 = cc.v2(-444, -117) - // let p2: cc.Vec2 = cc.v2(-264, -242) - if (this.bezierPList.length > this.targetMoveIndex + 2) { - let p0: Vec2 = this.bezierPList[this.targetMoveIndex] - let p1: Vec2 = this.bezierPList[this.targetMoveIndex + 1] - let p2: Vec2 = this.bezierPList[this.targetMoveIndex + 2] - let t: number = this.moveCount / this.totalTimes - let mx: number = - Math.pow(1 - t, 2) * p0.x + - 2 * t * (1 - t) * p1.x + - Math.pow(t, 2) * p2.x - let my: number = - Math.pow(1 - t, 2) * p0.y + - 2 * t * (1 - t) * p1.y + - Math.pow(t, 2) * p2.y - this.node.getPosition(this._vec3Cahce) - let rad: number = MathUtils.p2pRad( - new Vec2(this._vec3Cahce.x, this._vec3Cahce.y), - new Vec2(mx, my) - ) - let rot111: number = MathUtils.radiansToDegrees(rad) - let rot: number = MathUtils.rotation2Fish(rot111) - if (this.fishType == 7 || this.fishType == 27 || this.fishType == 29) { - if (rot > 90 || rot < -90) { - this.node.getScale(this._vec3Cahce) - if (this._vec3Cahce.x > 0) { - this._vec3Cahce.x = -1 * this._vec3Cahce.x - this.node.setScale(this._vec3Cahce) - } - } else { - this.node.getScale(this._vec3Cahce) - if (this._vec3Cahce.x < 0) { - this._vec3Cahce.x = -1 * this._vec3Cahce.x - this.node.setScale(this._vec3Cahce) - } - } - } else if ( - this.fishType == 9 || - this.fishType == 10 || - this.fishType == 21 || - this.fishType == 28 - ) { - } else { - // this.node.rotation = rot; //过时 - this.node.angle = -rot - } - // Logger.log("moveBezier====", rad, rot111, this.fishType, rot) - let moveTimes: number = Math.round(this.speed / this.minSpeed) - for (let i = 0; i < moveTimes; i++) { - let speedX: number = this.minSpeed * Math.cos(rad) - let speedY: number = this.minSpeed * Math.sin(rad) - this.node.getPosition(this._vec3Cahce) - this._vec3Cahce.x += speedX - this._vec3Cahce.y += speedY - this.node.setPosition(this._vec3Cahce) - if ( - MathUtils.distance(this._vec3Cahce.x, this._vec3Cahce.y, mx, my) <= - this.minSpeed - ) { - this.node.setPosition(mx, my) - break - } - if ( - MathUtils.distance( - this._vec3Cahce.x, - this._vec3Cahce.y, - p2.x, - p2.y - ) <= - this.minSpeed * 2 - ) { - this.node.setPosition(p2.x, p2.y) - this.targetMoveIndex += 2 - this.moveCount = 0 - break - } - } - } else { - this.isMoving = false - } - } + private checkMoveBezier() { + if (this.isMoving && !this.getComponent(FishBase).isDead) { + this.moveCount++ + if (this.moveCount >= this.totalTimes) { + this.moveCount = this.totalTimes + } + this.moveBezier() + } + } - onDisable() { - this.isMoving = false - } + public moveBezier() { + // [warn] [[-632,-230],[-444,-117],[-264,-242]] + // let p0: cc.Vec2 = cc.v2(-632, -230) + // let p1: cc.Vec2 = cc.v2(-444, -117) + // let p2: cc.Vec2 = cc.v2(-264, -242) + if (this.bezierPList.length > this.targetMoveIndex + 2) { + let p0: Vec2 = this.bezierPList[this.targetMoveIndex] + let p1: Vec2 = this.bezierPList[this.targetMoveIndex + 1] + let p2: Vec2 = this.bezierPList[this.targetMoveIndex + 2] + let t: number = this.moveCount / this.totalTimes + let mx: number = + Math.pow(1 - t, 2) * p0.x + + 2 * t * (1 - t) * p1.x + + Math.pow(t, 2) * p2.x + let my: number = + Math.pow(1 - t, 2) * p0.y + + 2 * t * (1 - t) * p1.y + + Math.pow(t, 2) * p2.y + this.node.getPosition(this._vec3Cahce) + let rad: number = MathUtils.p2pRad( + new Vec2(this._vec3Cahce.x, this._vec3Cahce.y), + new Vec2(mx, my) + ) + let rot111: number = MathUtils.radiansToDegrees(rad) + let rot: number = MathUtils.rotation2Fish(rot111) + if (this.fishType == 7 || this.fishType == 27 || this.fishType == 29) { + if (rot > 90 || rot < -90) { + this.node.getScale(this._vec3Cahce) + if (this._vec3Cahce.x > 0) { + this._vec3Cahce.x = -1 * this._vec3Cahce.x + this.node.setScale(this._vec3Cahce) + } + } else { + this.node.getScale(this._vec3Cahce) + if (this._vec3Cahce.x < 0) { + this._vec3Cahce.x = -1 * this._vec3Cahce.x + this.node.setScale(this._vec3Cahce) + } + } + } else if ( + this.fishType == 9 || + this.fishType == 10 || + this.fishType == 21 || + this.fishType == 28 + ) { + } else { + // this.node.rotation = rot; //过时 + this.node.angle = -rot + } + // Logger.log("moveBezier====", rad, rot111, this.fishType, rot) + let moveTimes: number = Math.round(this.speed / this.minSpeed) + for (let i = 0; i < moveTimes; i++) { + let speedX: number = this.minSpeed * Math.cos(rad) + let speedY: number = this.minSpeed * Math.sin(rad) + this.node.getPosition(this._vec3Cahce) + this._vec3Cahce.x += speedX + this._vec3Cahce.y += speedY + this.node.setPosition(this._vec3Cahce) + if ( + MathUtils.distance(this._vec3Cahce.x, this._vec3Cahce.y, mx, my) <= + this.minSpeed + ) { + this.node.setPosition(mx, my) + break + } + if ( + MathUtils.distance( + this._vec3Cahce.x, + this._vec3Cahce.y, + p2.x, + p2.y + ) <= + this.minSpeed * 2 + ) { + this.node.setPosition(p2.x, p2.y) + this.targetMoveIndex += 2 + this.moveCount = 0 + break + } + } + } else { + this.isMoving = false + } + } - public exportBezierConfig() { - Logger.warn('exportBezierConfig=') - let tempConfig: Array> = [] - for (let i = 0; i < this.bezierPList.length; i++) { - tempConfig[i] = [] - tempConfig[i].push(Math.floor(this.bezierPList[i].x)) - tempConfig[i].push(Math.floor(this.bezierPList[i].y)) - } - Logger.warn('fishtype', this.fishType) - Logger.warn('speed', this.speed) - Logger.warn('scale', this.node.scale) - Logger.warn(JSON.stringify(tempConfig)) - } + onDisable() { + this.isMoving = false + } + + public exportBezierConfig() { + Logger.warn('exportBezierConfig=') + let tempConfig: Array> = [] + for (let i = 0; i < this.bezierPList.length; i++) { + tempConfig[i] = [] + tempConfig[i].push(Math.floor(this.bezierPList[i].x)) + tempConfig[i].push(Math.floor(this.bezierPList[i].y)) + } + Logger.warn('fishtype', this.fishType) + Logger.warn('speed', this.speed) + Logger.warn('scale', this.node.scale) + Logger.warn(JSON.stringify(tempConfig)) + } } diff --git a/assets/FishSingle/script/engine/config/CommonEvent.ts b/assets/FishSingle/script/engine/config/CommonEvent.ts index f27d663..22869f1 100644 --- a/assets/FishSingle/script/engine/config/CommonEvent.ts +++ b/assets/FishSingle/script/engine/config/CommonEvent.ts @@ -1,4 +1,5 @@ import { _decorator } from 'cc' + const { ccclass, property } = _decorator @ccclass('CommonEvent') diff --git a/assets/FishSingle/script/engine/config/ManifestConfig.ts b/assets/FishSingle/script/engine/config/ManifestConfig.ts index 37c659c..10b8431 100644 --- a/assets/FishSingle/script/engine/config/ManifestConfig.ts +++ b/assets/FishSingle/script/engine/config/ManifestConfig.ts @@ -1,4 +1,3 @@ -import { _decorator } from 'cc' import DateUtil from '../utils/DateUtil' import NetConfig from './NetConfig' diff --git a/assets/FishSingle/script/engine/config/MusicConfig.ts b/assets/FishSingle/script/engine/config/MusicConfig.ts index 08499c2..99bb9f9 100644 --- a/assets/FishSingle/script/engine/config/MusicConfig.ts +++ b/assets/FishSingle/script/engine/config/MusicConfig.ts @@ -1,4 +1,4 @@ -import { _decorator, AudioClip } from 'cc' +import { AudioClip } from 'cc' import { GameConfig } from '../../game/config/GameConfig' export default class MusicConfig { diff --git a/assets/FishSingle/script/engine/config/NetConfig.ts b/assets/FishSingle/script/engine/config/NetConfig.ts index f5a817d..7632311 100644 --- a/assets/FishSingle/script/engine/config/NetConfig.ts +++ b/assets/FishSingle/script/engine/config/NetConfig.ts @@ -1,4 +1,3 @@ -import { _decorator } from 'cc' export default class NetConfig { public static hotupdateUrl: string = 'http://localhost:33/hotupdate' } diff --git a/assets/FishSingle/script/engine/uicomponent/CommonTips.ts b/assets/FishSingle/script/engine/uicomponent/CommonTips.ts index dcf339d..162e739 100644 --- a/assets/FishSingle/script/engine/uicomponent/CommonTips.ts +++ b/assets/FishSingle/script/engine/uicomponent/CommonTips.ts @@ -1,18 +1,10 @@ -import { - _decorator, - Component, - Label, - Node, - tween, - Vec3, - instantiate, -} from 'cc' -const { ccclass, property } = _decorator - +import { _decorator, Component, instantiate, Label, Node, tween, Vec3 } from 'cc' import PrefabLoader from '../utils/PrefabLoader' import { GameConfig } from '../../game/config/GameConfig' import DialogBase from './DialogBase' +const { ccclass, property } = _decorator + @ccclass('CommonTips') export default class CommonTips extends Component { public static TipsZorderIndex: number = 999 diff --git a/assets/FishSingle/script/engine/uicomponent/DarkLayer.ts b/assets/FishSingle/script/engine/uicomponent/DarkLayer.ts index af83f4a..bcaaaaa 100644 --- a/assets/FishSingle/script/engine/uicomponent/DarkLayer.ts +++ b/assets/FishSingle/script/engine/uicomponent/DarkLayer.ts @@ -1,10 +1,10 @@ -import { _decorator, Component, Prefab, Widget, instantiate, Node } from 'cc' -const { ccclass, property } = _decorator - +import { _decorator, Component, instantiate, Node, Prefab, Widget } from 'cc' import PrefabLoader from '../utils/PrefabLoader' import { GameConfig } from '../../game/config/GameConfig' import DialogBase from './DialogBase' +const { ccclass, property } = _decorator + @ccclass('DarkLayer') export default class DarkLayer extends Component { private static prefab: Prefab diff --git a/assets/FishSingle/script/engine/uicomponent/DialogBase.ts b/assets/FishSingle/script/engine/uicomponent/DialogBase.ts index a8a71cf..a8a5063 100644 --- a/assets/FishSingle/script/engine/uicomponent/DialogBase.ts +++ b/assets/FishSingle/script/engine/uicomponent/DialogBase.ts @@ -1,9 +1,9 @@ -import { _decorator, Component, Node, Widget, director } from 'cc' -const { ccclass } = _decorator - +import { _decorator, Component, Node, Widget } from 'cc' import DarkLayer from './DarkLayer' import { UIRoot } from '../../game/utils/UIRoot' +const { ccclass } = _decorator + @ccclass('DialogBase') export default class DialogBase extends Component { private static LocalZOrder: number = 5 diff --git a/assets/FishSingle/script/engine/uicomponent/LoadingPrefab.ts b/assets/FishSingle/script/engine/uicomponent/LoadingPrefab.ts index 403d950..6b1d2c9 100644 --- a/assets/FishSingle/script/engine/uicomponent/LoadingPrefab.ts +++ b/assets/FishSingle/script/engine/uicomponent/LoadingPrefab.ts @@ -1,19 +1,10 @@ -import { - _decorator, - Component, - Node, - Prefab, - instantiate, - math, - Quat, - Vec3, -} from 'cc' -const { ccclass, property } = _decorator - +import { _decorator, Component, instantiate, Node, Prefab, Quat, Vec3 } from 'cc' import PrefabLoader from '../utils/PrefabLoader' import { GameConfig } from '../../game/config/GameConfig' import DialogBase from './DialogBase' +const { ccclass, property } = _decorator + @ccclass('LoadingPrefab') export default class LoadingPrefab extends Component { public static instance: Node diff --git a/assets/FishSingle/script/engine/uicomponent/LoadingScenePrefab.ts b/assets/FishSingle/script/engine/uicomponent/LoadingScenePrefab.ts index ecbc5c6..1bc7a0e 100644 --- a/assets/FishSingle/script/engine/uicomponent/LoadingScenePrefab.ts +++ b/assets/FishSingle/script/engine/uicomponent/LoadingScenePrefab.ts @@ -1,11 +1,11 @@ -import { _decorator, Component, Node, Prefab, instantiate } from 'cc' -const { ccclass, property } = _decorator - +import { _decorator, Component, instantiate, Node, Prefab } from 'cc' import PrefabLoader from '../utils/PrefabLoader' import Progress from './Progress' import { GameConfig } from '../../game/config/GameConfig' import DialogBase from './DialogBase' +const { ccclass, property } = _decorator + @ccclass('LoadingScenePrefab') export default class LoadingScenePrefab extends Component { public static instance: Node diff --git a/assets/FishSingle/script/engine/uicomponent/MusicPrefab.ts b/assets/FishSingle/script/engine/uicomponent/MusicPrefab.ts index 6ee2381..e0f69d1 100644 --- a/assets/FishSingle/script/engine/uicomponent/MusicPrefab.ts +++ b/assets/FishSingle/script/engine/uicomponent/MusicPrefab.ts @@ -1,19 +1,12 @@ -import { - _decorator, - Component, - AssetManager, - AudioClip, - AudioSource, - instantiate, - Prefab, -} from 'cc' -const { ccclass, property } = _decorator - +import { _decorator, AssetManager, AudioClip, AudioSource, Component, instantiate, Prefab } from 'cc' import { Logger } from '../utils/Logger' import PrefabLoader from '../utils/PrefabLoader' import LocalStorage from '../utils/LocalStorage' import MusicConfig from '../config/MusicConfig' import { GameConfig } from '../../game/config/GameConfig' + +const { ccclass, property } = _decorator + /** * 背景音乐 */ diff --git a/assets/FishSingle/script/engine/uicomponent/Progress.ts b/assets/FishSingle/script/engine/uicomponent/Progress.ts index 8f13471..04ebf32 100644 --- a/assets/FishSingle/script/engine/uicomponent/Progress.ts +++ b/assets/FishSingle/script/engine/uicomponent/Progress.ts @@ -1,7 +1,6 @@ import { _decorator, Component, Label, ProgressBar } from 'cc' -const { ccclass, property } = _decorator -import { Logger } from '../utils/Logger' +const { ccclass, property } = _decorator @ccclass('Progress') export default class Progress extends Component { diff --git a/assets/FishSingle/script/engine/uicomponent/SoundPrefab.ts b/assets/FishSingle/script/engine/uicomponent/SoundPrefab.ts index 6ea086d..7eec9a2 100644 --- a/assets/FishSingle/script/engine/uicomponent/SoundPrefab.ts +++ b/assets/FishSingle/script/engine/uicomponent/SoundPrefab.ts @@ -1,16 +1,4 @@ -import { - _decorator, - Component, - Prefab, - NodePool, - Node, - instantiate, - AssetManager, - AudioClip, - AudioSource, -} from 'cc' -const { ccclass, property } = _decorator - +import { _decorator, AssetManager, AudioClip, AudioSource, Component, instantiate, Node, NodePool, Prefab } from 'cc' import { Logger } from '../utils/Logger' import PrefabLoader from '../utils/PrefabLoader' import LocalStorage from '../utils/LocalStorage' @@ -18,6 +6,9 @@ import EventManager from '../utils/EventManager' import CommonEvent from '../config/CommonEvent' import MusicConfig from '../config/MusicConfig' import { GameConfig } from '../../game/config/GameConfig' + +const { ccclass, property } = _decorator + // /** // * 音效 // * Ios暂时有bug,弃用 diff --git a/assets/FishSingle/script/engine/uicomponent/TextureMgr.ts b/assets/FishSingle/script/engine/uicomponent/TextureMgr.ts index 533928f..3a22fe2 100644 --- a/assets/FishSingle/script/engine/uicomponent/TextureMgr.ts +++ b/assets/FishSingle/script/engine/uicomponent/TextureMgr.ts @@ -1,4 +1,5 @@ import { _decorator, Component, SpriteFrame } from 'cc' + const { ccclass, property } = _decorator @ccclass('TextureMgr') diff --git a/assets/FishSingle/script/engine/utils/AdapterHelper.ts b/assets/FishSingle/script/engine/utils/AdapterHelper.ts index 8100d35..12cc9d9 100644 --- a/assets/FishSingle/script/engine/utils/AdapterHelper.ts +++ b/assets/FishSingle/script/engine/utils/AdapterHelper.ts @@ -1,38 +1,38 @@ -import { Canvas, error, log, ResolutionPolicy, sys, view, _decorator } from 'cc' +import { _decorator, Canvas, error, log, view } from 'cc' import DialogBase from '../uicomponent/DialogBase' -const { ccclass, property } = _decorator -import { Logger } from './Logger' +const { ccclass, property } = _decorator @ccclass('AdapterHelper') export default class AdapterHelper { - public static winSizeWidth: number - public static winSizeHeiht: number - public static fixApdater() { - log('v3.6没找到接口修改 fitHeight、fitWidth, 先在项目里写死fitHeight=true') - return - let framesize = view.getFrameSize() - if (!this.winSizeWidth) { - this.winSizeWidth = screen.width - this.winSizeHeiht = screen.height - } - let designsize = view.getDesignResolutionSize() - let canvas: Canvas = DialogBase.GetRootCanvas().getComponent(Canvas) + public static winSizeWidth: number + public static winSizeHeiht: number - let ratio: number = framesize.height / framesize.width - let designRatio: number = designsize.height / designsize.width - if (ratio > designRatio) { - //canvas.fitHeight = false; - //canvas.fitWidth = true; - error( - 'v3.6没找到接口修改 fitHeight、fitWidth, 先在项目里写死fitHeight=true' - ) - } else { - //canvas.fitHeight = true; - //canvas.fitWidth = false; - error( - 'v3.6没找到接口修改 fitHeight、fitWidth, 先在项目里写死fitHeight=true' - ) - } - } + public static fixApdater() { + log('v3.6没找到接口修改 fitHeight、fitWidth, 先在项目里写死fitHeight=true') + return + let framesize = view.getFrameSize() + if (!this.winSizeWidth) { + this.winSizeWidth = screen.width + this.winSizeHeiht = screen.height + } + let designsize = view.getDesignResolutionSize() + let canvas: Canvas = DialogBase.GetRootCanvas().getComponent(Canvas) + + let ratio: number = framesize.height / framesize.width + let designRatio: number = designsize.height / designsize.width + if (ratio > designRatio) { + //canvas.fitHeight = false; + //canvas.fitWidth = true; + error( + 'v3.6没找到接口修改 fitHeight、fitWidth, 先在项目里写死fitHeight=true' + ) + } else { + //canvas.fitHeight = true; + //canvas.fitWidth = false; + error( + 'v3.6没找到接口修改 fitHeight、fitWidth, 先在项目里写死fitHeight=true' + ) + } + } } diff --git a/assets/FishSingle/script/engine/utils/BitUtil.ts b/assets/FishSingle/script/engine/utils/BitUtil.ts index d2dd7aa..2506ca5 100644 --- a/assets/FishSingle/script/engine/utils/BitUtil.ts +++ b/assets/FishSingle/script/engine/utils/BitUtil.ts @@ -1,52 +1,48 @@ import { _decorator } from 'cc' -const { ccclass, property } = _decorator -import { Logger } from './Logger' +const { ccclass, property } = _decorator @ccclass('BitUtil') export default class BitUtil { - //index是二进制从右到左 - public static isBitSet(value: number, index: number): boolean { - let str: string = value.toString(2) - if (parseInt(str[str.length - 1 - index]) == 1) { - return true - } - return false - } + //index是二进制从右到左 + public static isBitSet(value: number, index: number): boolean { + let str: string = value.toString(2) + return parseInt(str[str.length - 1 - index]) == 1 + } - //从右到左计算 - public static setBitValue(value: number, index: number): number { - let newValue: number = value - let str: string = value.toString(2) - let newStr: string = '' - let maxIndex = Math.max(str.length - 1, index) - for (let i = 0; i <= maxIndex; i++) { - if (index == i) { - newStr = '1' + newStr - } else { - if (str[i] == undefined) { - newStr = '0' + newStr - } else { - newStr = str[i] + newStr - } - } - } - newValue = parseInt(newStr, 2) - return newValue - } + //从右到左计算 + public static setBitValue(value: number, index: number): number { + let newValue: number = value + let str: string = value.toString(2) + let newStr: string = '' + let maxIndex = Math.max(str.length - 1, index) + for (let i = 0; i <= maxIndex; i++) { + if (index == i) { + newStr = '1' + newStr + } else { + if (str[i] == undefined) { + newStr = '0' + newStr + } else { + newStr = str[i] + newStr + } + } + } + newValue = parseInt(newStr, 2) + return newValue + } - public static clearBitValue(value: number, index: number) { - let newValue: number = value - let str: string = value.toString(2) - let newStr: string = '' - for (let i = str.length - 1; i >= 0; i--) { - if (index == str.length - 1 - i) { - newStr = '0' + newStr - } else { - newStr = str[i] + newStr - } - } - newValue = parseInt(newStr, 2) - return newValue - } + public static clearBitValue(value: number, index: number) { + let newValue: number = value + let str: string = value.toString(2) + let newStr: string = '' + for (let i = str.length - 1; i >= 0; i--) { + if (index == str.length - 1 - i) { + newStr = '0' + newStr + } else { + newStr = str[i] + newStr + } + } + newValue = parseInt(newStr, 2) + return newValue + } } diff --git a/assets/FishSingle/script/engine/utils/ColorHelper.ts b/assets/FishSingle/script/engine/utils/ColorHelper.ts index 34687e6..326d9bd 100644 --- a/assets/FishSingle/script/engine/utils/ColorHelper.ts +++ b/assets/FishSingle/script/engine/utils/ColorHelper.ts @@ -1,10 +1,11 @@ import { _decorator, Color } from 'cc' + const { ccclass, property } = _decorator @ccclass('ColorHelper') export default class ColorHelper { - public static getColor(hexStr: string): Color { - let color: Color = Color.BLACK - return color.fromHEX(hexStr) - } + public static getColor(hexStr: string): Color { + let color: Color = Color.BLACK + return color.fromHEX(hexStr) + } } diff --git a/assets/FishSingle/script/engine/utils/DateUtil.ts b/assets/FishSingle/script/engine/utils/DateUtil.ts index 7cbffa2..9e8bf82 100644 --- a/assets/FishSingle/script/engine/utils/DateUtil.ts +++ b/assets/FishSingle/script/engine/utils/DateUtil.ts @@ -1,139 +1,136 @@ -import { _decorator } from 'cc' -import { Logger } from './Logger' - export default class DateUtil { - public static formatNumStr(num: number) { - let str = '' + num - if (num < 10) { - str = '0' + num - } - return str - } + public static formatNumStr(num: number) { + let str = '' + num + if (num < 10) { + str = '0' + num + } + return str + } - public static formateYearMonthDayStr(timestamp: number) { - let date: Date = new Date(timestamp) - return ( - date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() - ) - } + public static formateYearMonthDayStr(timestamp: number) { + let date: Date = new Date(timestamp) + return ( + date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ) + } - public static formateMonthDayStr(timestamp: number) { - let date: Date = new Date(timestamp) - return date.getMonth() + 1 + '月' + date.getDate() + '日' - } + public static formateMonthDayStr(timestamp: number) { + let date: Date = new Date(timestamp) + return date.getMonth() + 1 + '月' + date.getDate() + '日' + } - // timestamp:1453094034000 2018-1-31 19:53:44 - //根据时间戳返回 2018-1-31 19:53:44 - public static formatDateStr(timestamp: number) { - let date: Date = new Date(timestamp) - return ( - date.getFullYear() + - '-' + - (date.getMonth() + 1) + - '-' + - date.getDate() + - ' ' + - this.formatNumStr(date.getHours()) + - ':' + - this.formatNumStr(date.getMinutes()) + - ':' + - this.formatNumStr(date.getSeconds()) - ) - } + // timestamp:1453094034000 2018-1-31 19:53:44 + //根据时间戳返回 2018-1-31 19:53:44 + public static formatDateStr(timestamp: number) { + let date: Date = new Date(timestamp) + return ( + date.getFullYear() + + '-' + + (date.getMonth() + 1) + + '-' + + date.getDate() + + ' ' + + this.formatNumStr(date.getHours()) + + ':' + + this.formatNumStr(date.getMinutes()) + + ':' + + this.formatNumStr(date.getSeconds()) + ) + } - // timestamp:1453094034000 2018-1-31-19-53-44 - //根据时间戳返回 2018-1-31-19-53-44 - public static formatDateStr2(timestamp: number) { - let date: Date = new Date(timestamp) - return ( - date.getFullYear() + - '-' + - (date.getMonth() + 1) + - '-' + - date.getDate() + - '-' + - this.formatNumStr(date.getHours()) + - '-' + - this.formatNumStr(date.getMinutes()) + - '-' + - this.formatNumStr(date.getSeconds()) - ) - } + // timestamp:1453094034000 2018-1-31-19-53-44 + //根据时间戳返回 2018-1-31-19-53-44 + public static formatDateStr2(timestamp: number) { + let date: Date = new Date(timestamp) + return ( + date.getFullYear() + + '-' + + (date.getMonth() + 1) + + '-' + + date.getDate() + + '-' + + this.formatNumStr(date.getHours()) + + '-' + + this.formatNumStr(date.getMinutes()) + + '-' + + this.formatNumStr(date.getSeconds()) + ) + } - // timestamp:1453094034000 2018-1-31 - //根据时间戳返回 2018-1-31 - public static formatDateStr3(timestamp: number) { - let date: Date = new Date(timestamp) - return ( - date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() - ) - } + // timestamp:1453094034000 2018-1-31 + //根据时间戳返回 2018-1-31 + public static formatDateStr3(timestamp: number) { + let date: Date = new Date(timestamp) + return ( + date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ) + } - // timestamp:1453094034000 - //根据时间戳返回 19:53 - public static formatHourMinStr(timestamp: number) { - let date: Date = new Date(timestamp) - return ( - this.formatNumStr(date.getHours()) + - ':' + - this.formatNumStr(date.getMinutes()) - ) - } + // timestamp:1453094034000 + //根据时间戳返回 19:53 + public static formatHourMinStr(timestamp: number) { + let date: Date = new Date(timestamp) + return ( + this.formatNumStr(date.getHours()) + + ':' + + this.formatNumStr(date.getMinutes()) + ) + } - // timestamp:1453094034000 - //根据时间戳返回 19:53:11 - public static formatHourMinSecondStr(timestamp: number) { - let date: Date = new Date(timestamp) - return ( - this.formatNumStr(date.getHours()) + - ':' + - this.formatNumStr(date.getMinutes()) + - ':' + - this.formatNumStr(date.getSeconds()) - ) - } + // timestamp:1453094034000 + //根据时间戳返回 19:53:11 + public static formatHourMinSecondStr(timestamp: number) { + let date: Date = new Date(timestamp) + return ( + this.formatNumStr(date.getHours()) + + ':' + + this.formatNumStr(date.getMinutes()) + + ':' + + this.formatNumStr(date.getSeconds()) + ) + } - public static now(): number { - let date: Date = new Date() - return date.getTime() - } + public static now(): number { + let date: Date = new Date() + return date.getTime() + } - public static betweenTime(startTime: number, endTime: number) { - let date: Date = new Date() - if (date.getTime() >= startTime && date.getTime() <= endTime) { - return true - } - return false - } + public static betweenTime(startTime: number, endTime: number) { + let date: Date = new Date() + if (date.getTime() >= startTime && date.getTime() <= endTime) { + return true + } + return false + } - //根据时间戳返回 1天19:53:11 - public static formatLeftTime(timestamp: number) { - let result: string = '' - let day: number = Math.floor(timestamp / (1000 * 60 * 60 * 24)) - let hour: number = Math.floor(timestamp / (1000 * 60 * 60)) % 24 - let min: number = Math.floor(timestamp / (1000 * 60)) % 60 - let second: number = Math.floor(timestamp / 1000) % 60 - result = - day + - '天' + - this.formatNumStr(hour) + - ':' + - this.formatNumStr(min) + - ':' + - this.formatNumStr(second) - return result - } + //根据时间戳返回 1天19:53:11 + public static formatLeftTime(timestamp: number) { + let result: string = '' + let day: number = Math.floor(timestamp / (1000 * 60 * 60 * 24)) + let hour: number = Math.floor(timestamp / (1000 * 60 * 60)) % 24 + let min: number = Math.floor(timestamp / (1000 * 60)) % 60 + let second: number = Math.floor(timestamp / 1000) % 60 + result = + day + + '天' + + this.formatNumStr(hour) + + ':' + + this.formatNumStr(min) + + ':' + + this.formatNumStr(second) + return result + } - public static isToday(dateTime: number): boolean { - let nowDate: Date = new Date() - let checkDate: Date = new Date(dateTime) - if ( - checkDate.getFullYear() == nowDate.getFullYear() && - checkDate.getMonth() == nowDate.getMonth() && - checkDate.getDate() == nowDate.getDate() - ) { - return true - } - return false - } + public static isToday(dateTime: number): boolean { + let nowDate: Date = new Date() + let checkDate: Date = new Date(dateTime) + if ( + checkDate.getFullYear() == nowDate.getFullYear() && + checkDate.getMonth() == nowDate.getMonth() && + checkDate.getDate() == nowDate.getDate() + ) { + return true + } + return false + } } diff --git a/assets/FishSingle/script/engine/utils/EventManager.ts b/assets/FishSingle/script/engine/utils/EventManager.ts index 077a3fe..ecf520c 100644 --- a/assets/FishSingle/script/engine/utils/EventManager.ts +++ b/assets/FishSingle/script/engine/utils/EventManager.ts @@ -1,131 +1,132 @@ -import { _decorator, Node, Color, Button, Component, Slider } from 'cc' -import { Logger } from './Logger' +import { Button, Color, Component, Node, Slider } from 'cc' import ColorHelper from './ColorHelper' export class HaoEvent { - public callback: Function - public caller: any - public isStop: boolean - constructor(callback: Function, caller: any) { - this.callback = callback - this.caller = caller - this.isStop = false - } + public callback: Function + public caller: any + public isStop: boolean + + constructor(callback: Function, caller: any) { + this.callback = callback + this.caller = caller + this.isStop = false + } } export default class EventManager { - public static instance: EventManager = new EventManager() + public static instance: EventManager = new EventManager() - private callbackList = {} + private callbackList = {} - public constructor() {} + public constructor() { + } - //注册事件 - public addListener(eventName: string, callback: Function, caller: any) { - if (this.callbackList[eventName]) { - let eventList: Array = this.callbackList[eventName] - //不同元件才放入,相同元件覆蓋 - let add: boolean = true - for (let i = 0; i < eventList.length; i++) { - let event: HaoEvent = eventList[i] - if (caller === event.caller) { - add = false - } - } - if (add) { - eventList.push(new HaoEvent(callback, caller)) - this.callbackList[eventName] = eventList - } - } else { - // this.callbackList[eventName] = [[callback, caller]]; - this.callbackList[eventName] = [new HaoEvent(callback, caller)] - } - } + //注册事件 + public addListener(eventName: string, callback: Function, caller: any) { + if (this.callbackList[eventName]) { + let eventList: Array = this.callbackList[eventName] + //不同元件才放入,相同元件覆蓋 + let add: boolean = true + for (let i = 0; i < eventList.length; i++) { + let event: HaoEvent = eventList[i] + if (caller === event.caller) { + add = false + } + } + if (add) { + eventList.push(new HaoEvent(callback, caller)) + this.callbackList[eventName] = eventList + } + } else { + // this.callbackList[eventName] = [[callback, caller]]; + this.callbackList[eventName] = [new HaoEvent(callback, caller)] + } + } - public removeListener(eventName: string, callback: Function) { - if (this.callbackList[eventName]) { - for (let i = this.callbackList[eventName].length - 1; i >= 0; i--) { - let event: HaoEvent = this.callbackList[eventName][i] - if (event.callback == callback) { - this.callbackList[eventName].splice(i, 1) - break - } - } - } - } + public removeListener(eventName: string, callback: Function) { + if (this.callbackList[eventName]) { + for (let i = this.callbackList[eventName].length - 1; i >= 0; i--) { + let event: HaoEvent = this.callbackList[eventName][i] + if (event.callback == callback) { + this.callbackList[eventName].splice(i, 1) + break + } + } + } + } - public dispatchEvent(eventName, parameter?: any, ...restOfName: any[]) { - let eventList: Array = this.callbackList[eventName] - if (eventList) { - for (let i = eventList.length - 1; i >= 0; i--) { - let event: HaoEvent = eventList[i] - event.callback.call(event.caller, event, parameter, ...restOfName) - if (event.isStop) { - break - } - } - for (let i = eventList.length - 1; i >= 0; i--) { - let event: HaoEvent = eventList[i] - event.isStop = false - } - } - } + public dispatchEvent(eventName, parameter?: any, ...restOfName: any[]) { + let eventList: Array = this.callbackList[eventName] + if (eventList) { + for (let i = eventList.length - 1; i >= 0; i--) { + let event: HaoEvent = eventList[i] + event.callback.call(event.caller, event, parameter, ...restOfName) + if (event.isStop) { + break + } + } + for (let i = eventList.length - 1; i >= 0; i--) { + let event: HaoEvent = eventList[i] + event.isStop = false + } + } + } - public addBtnEvent( - parentNode: Node, - objectNode: Node, - scriptName: string, - eventName: string, - data: any = null - ) { - var btn: Button = objectNode.addComponent(Button) - var clickEventHandler = new Component.EventHandler() - clickEventHandler.target = parentNode //这个 node 节点是你的事件处理代码组件所属的节点 - clickEventHandler.component = scriptName //这个是代码文件名 - clickEventHandler.handler = eventName - clickEventHandler.customEventData = data - btn.clickEvents.push(clickEventHandler) - this.addBtnEffect(objectNode) - } + public addBtnEvent( + parentNode: Node, + objectNode: Node, + scriptName: string, + eventName: string, + data: any = null + ) { + var btn: Button = objectNode.addComponent(Button) + var clickEventHandler = new Component.EventHandler() + clickEventHandler.target = parentNode //这个 node 节点是你的事件处理代码组件所属的节点 + clickEventHandler.component = scriptName //这个是代码文件名 + clickEventHandler.handler = eventName + clickEventHandler.customEventData = data + btn.clickEvents.push(clickEventHandler) + this.addBtnEffect(objectNode) + } - public removeBtnEvent(objectNode: Node) { - objectNode.removeComponent(Button) - } + public removeBtnEvent(objectNode: Node) { + objectNode.removeComponent(Button) + } - public removeBtnEffect(objectNode: Node) { - var b = objectNode.getComponent(Button) - b.transition = Button.Transition.NONE - } + public removeBtnEffect(objectNode: Node) { + var b = objectNode.getComponent(Button) + b.transition = Button.Transition.NONE + } - public addBtnEffect(objectNode: Node, scale: number = 1.1) { - var b = objectNode.getComponent(Button) - b.transition = Button.Transition.SCALE - b.zoomScale = scale - } + public addBtnEffect(objectNode: Node, scale: number = 1.1) { + var b = objectNode.getComponent(Button) + b.transition = Button.Transition.SCALE + b.zoomScale = scale + } - public addBtnEffect_color( - objectNode: Node, - normalC: Color = ColorHelper.getColor('#FFFFFF'), - pressC: Color = ColorHelper.getColor('#C0C0C0') - ) { - var b = objectNode.getComponent(Button) - b.transition = Button.Transition.COLOR - b.normalColor = normalC - b.pressedColor = pressC - } + public addBtnEffect_color( + objectNode: Node, + normalC: Color = ColorHelper.getColor('#FFFFFF'), + pressC: Color = ColorHelper.getColor('#C0C0C0') + ) { + var b = objectNode.getComponent(Button) + b.transition = Button.Transition.COLOR + b.normalColor = normalC + b.pressedColor = pressC + } - public addSliderEvent( - parentNode: Node, - objectNode: Node, - EventName: string, - data: any - ) { - var b = objectNode.getComponent(Slider) - var clickEventHandler = new Component.EventHandler() - clickEventHandler.target = parentNode //这个 node 节点是你的事件处理代码组件所属的节点 - clickEventHandler.component = parentNode.name //这个是代码文件名 - clickEventHandler.handler = EventName - clickEventHandler.customEventData = data - b.slideEvents.push(clickEventHandler) - } + public addSliderEvent( + parentNode: Node, + objectNode: Node, + EventName: string, + data: any + ) { + var b = objectNode.getComponent(Slider) + var clickEventHandler = new Component.EventHandler() + clickEventHandler.target = parentNode //这个 node 节点是你的事件处理代码组件所属的节点 + clickEventHandler.component = parentNode.name //这个是代码文件名 + clickEventHandler.handler = EventName + clickEventHandler.customEventData = data + b.slideEvents.push(clickEventHandler) + } } diff --git a/assets/FishSingle/script/engine/utils/Grid.ts b/assets/FishSingle/script/engine/utils/Grid.ts index 1a18b29..934f0c8 100644 --- a/assets/FishSingle/script/engine/utils/Grid.ts +++ b/assets/FishSingle/script/engine/utils/Grid.ts @@ -1,13 +1,13 @@ -import { _decorator } from 'cc' export default class Grid { - public row: number - public col: number - constructor(row: number, col) { - this.row = row - this.col = col - } + public row: number + public col: number - public static init(row: number, col: number) { - return new Grid(row, col) - } + constructor(row: number, col: number) { + this.row = row + this.col = col + } + + public static init(row: number, col: number) { + return new Grid(row, col) + } } diff --git a/assets/FishSingle/script/engine/utils/HaoEncrypt.ts b/assets/FishSingle/script/engine/utils/HaoEncrypt.ts index 98bd0c0..e11daa9 100644 --- a/assets/FishSingle/script/engine/utils/HaoEncrypt.ts +++ b/assets/FishSingle/script/engine/utils/HaoEncrypt.ts @@ -1,34 +1,31 @@ -import { _decorator } from 'cc' -import { Logger } from './Logger' - export default class HaoEncrypt { - public static encode(str: string) { - let result: string = '' - for (let i = 0; i < str.length; i++) { - //遍历字符串 - let code: number = str.charCodeAt(i) // //逐个提取每个字符,并获取Unicode编码值 - if (i % 2 == 0) { - code += 2 - } else { - code += 1 - } - result += String.fromCharCode(code) - } - return result - } + public static encode(str: string) { + let result: string = '' + for (let i = 0; i < str.length; i++) { + //遍历字符串 + let code: number = str.charCodeAt(i) // //逐个提取每个字符,并获取Unicode编码值 + if (i % 2 == 0) { + code += 2 + } else { + code += 1 + } + result += String.fromCharCode(code) + } + return result + } - public static decode(str: string) { - let result: string = '' - for (let i = 0; i < str.length; i++) { - //遍历字符串 - let code: number = str.charCodeAt(i) // //逐个提取每个字符,并获取Unicode编码值 - if (i % 2 == 0) { - code -= 2 - } else { - code -= 1 - } - result += String.fromCharCode(code) - } - return result - } + public static decode(str: string) { + let result: string = '' + for (let i = 0; i < str.length; i++) { + //遍历字符串 + let code: number = str.charCodeAt(i) // //逐个提取每个字符,并获取Unicode编码值 + if (i % 2 == 0) { + code -= 2 + } else { + code -= 1 + } + result += String.fromCharCode(code) + } + return result + } } diff --git a/assets/FishSingle/script/engine/utils/HotUpdate.ts b/assets/FishSingle/script/engine/utils/HotUpdate.ts index 31c182b..1f8fb64 100644 --- a/assets/FishSingle/script/engine/utils/HotUpdate.ts +++ b/assets/FishSingle/script/engine/utils/HotUpdate.ts @@ -1,4 +1,4 @@ -import { sys, _decorator, native, System } from 'cc' +import { native, sys } from 'cc' import { Logger } from './Logger' import EventManager from './EventManager' import VersionManager from './VersionManager' @@ -7,326 +7,315 @@ import ResourcePreload from '../../game/utils/ResourcePreload' import CommonTips from '../uicomponent/CommonTips' export default class HotUpdate { - public static Event_CheckUpdate: string = 'Event_CheckUpdate' - public static Event_On_Progress: string = 'HotUpdate_Event_On_Progress' - public static Event_On_NeedUpdate: string = 'HotUpdate_Event_On_NeedUpdate' - public static Event_Finish_Update: string = 'HotUpdate_Event_Finish' - public static Event_On_ALREADY_UP_TO_DATE: string = - 'HotUpdate_Event_On_ALREADY_UP_TO_DATE' - public static Event_On_Fail_Update: string = 'HotUpdate_Event_On_Fail_Update' - private _am: any - private _checkListener - private storagePath: string - private manifestUrl: string - private localBigVersion: number - private remoteBigVersion: number - public needUpdate: boolean = false - public isUpdating: boolean - public isFinishUpdate: boolean - public isCheck: boolean - private key: string - private hotupdateIndex: number - constructor() {} - public init( - index: number, - key: string = 'Code-remote-asset', - manifestUrl: string - ) { - if (sys.isNative) { - this.hotupdateIndex = index - this.key = key - this.manifestUrl = manifestUrl - if (false) { - //暂时不想修 fileUtils 这个报错 - //暂时注释 - // this.storagePath = jsb.fileUtils.getWritablePath() + key; - // if (!jsb.fileUtils.isDirectoryExist(this.storagePath)) { - // jsb.fileUtils.createDirectory(this.storagePath) - // } - } else { - this.storagePath = '获取this.storagePath报错了' - } + public static Event_CheckUpdate: string = 'Event_CheckUpdate' + public static Event_On_Progress: string = 'HotUpdate_Event_On_Progress' + public static Event_On_NeedUpdate: string = 'HotUpdate_Event_On_NeedUpdate' + public static Event_Finish_Update: string = 'HotUpdate_Event_Finish' + public static Event_On_ALREADY_UP_TO_DATE: string = + 'HotUpdate_Event_On_ALREADY_UP_TO_DATE' + public static Event_On_Fail_Update: string = 'HotUpdate_Event_On_Fail_Update' + private _am: any + private _checkListener: null + private storagePath: string + private manifestUrl: string + private localBigVersion: number + private remoteBigVersion: number + public needUpdate: boolean = false + public isUpdating: boolean + public isFinishUpdate: boolean + public isCheck: boolean + private key: string + private hotupdateIndex: number - Logger.log(this, 'init removeDirectory=', this.storagePath + '_temp') - } - this.needUpdate = false - this.isUpdating = false - this.isFinishUpdate = false - this.isCheck = false - } + constructor() { + } - private jumpToPack() { - let url: string - if (sys.isNative) { - if (sys.os == sys.OS.ANDROID) { - url = VersionManager.instance.apkStoreUrl - } else if (sys.os == sys.OS.IOS) { - url = VersionManager.instance.iosStoreUrl - } - } - Logger.info( - this, - 'jumpToPack==androidurl===', - VersionManager.instance.apkStoreUrl - ) - Logger.info( - this, - 'jumpToPack==iosStoreUrl===', - VersionManager.instance.iosStoreUrl - ) - Logger.info(this, 'jumpToPack=====', url) - sys.openURL(url) - // cc.game.end(); - } + public init( + index: number, + key: string = 'Code-remote-asset', + manifestUrl: string + ) { + if (sys.isNative) { + this.hotupdateIndex = index + this.key = key + this.manifestUrl = manifestUrl + this.storagePath = '获取this.storagePath报错了' - //显示强制更新,即更细包面板 - private showPackUpdateDialog() { - CommonTips.showMsg( - '有新的版本需要更新,下载后请先卸载,以前的版本,再安装!' - ) - this.jumpToPack() - this.showPackUpdateDialog() - } + Logger.log(this, 'init removeDirectory=', this.storagePath + '_temp') + } + this.needUpdate = false + this.isUpdating = false + this.isFinishUpdate = false + this.isCheck = false + } - private checkCb(event) { - Logger.log(this, 'checkCb Code: =================' + event.getEventCode()) - switch (event.getEventCode()) { - case native.EventAssetsManager.ERROR_NO_LOCAL_MANIFEST: - Logger.info(this, 'No local manifest file found, hot update skipped.') - this.failUpdate() - break - case native.EventAssetsManager.ERROR_DOWNLOAD_MANIFEST: - case native.EventAssetsManager.ERROR_PARSE_MANIFEST: - Logger.info(this, 'Fail to download manifest file, hot update skipped.') - this.failUpdate() - break - case native.EventAssetsManager.ALREADY_UP_TO_DATE: - Logger.info(this, 'Already up to date with the latest remote version.') - this.alreadyUpToDate() - break - case native.EventAssetsManager.NEW_VERSION_FOUND: - Logger.info( - this, - 'new version found, please try to update.', - this.localBigVersion, - this.remoteBigVersion - ) - if ( - this.key == VersionManager.Config_Key[0] && - this.localBigVersion < this.remoteBigVersion - ) { - //更新大版本 - Logger.info( - this, - 'new version found, please try to update======packupdate=', - this.localBigVersion, - this.remoteBigVersion - ) - this.showPackUpdateDialog() - } else { - Logger.info( - this, - 'new version found, please try to update======hotupdate=', - this.localBigVersion, - this.remoteBigVersion - ) - // this._am.update(); - this.needUpdate = true - EventManager.instance.dispatchEvent( - HotUpdate.Event_On_NeedUpdate, - this.key - ) - } - break - case native.EventAssetsManager.UPDATE_PROGRESSION: - // var currentPercent = event.getPercent(); - // var totalPercent = event.getPercentByFile(); - // var fileprocess = event.getDownloadedFiles() + ' / ' + event.getTotalFiles(); - // var byteprocess = event.getDownloadedBytes() + ' / ' + event.getTotalBytes(); - Logger.info( - this, - 'UPDATE_PROGRESSION2222==========', - this.key, - event.getDownloadedBytes(), - event.getTotalBytes() - ) - if (event.getTotalBytes() > 0) { - EventManager.instance.dispatchEvent( - HotUpdate.Event_On_Progress, - event.getDownloadedBytes(), - event.getTotalBytes(), - this.key - ) - } - break - case native.EventAssetsManager.UPDATE_FINISHED: - Logger.info(this, 'UPDATE_FINISHED==============') - this.finishUpdate(true) - break - case native.EventAssetsManager.UPDATE_FAILED: - Logger.warn(this, 'Update failed==========', event.getMessage()) - this.failUpdate() - break - case native.EventAssetsManager.ERROR_UPDATING: - let fullFilePath: string = this.storagePath + '/' + event.getAssetId() - let tempFilePath: string = - this.storagePath + '_temp/' + event.getAssetId() - Logger.warn(this, 'fullFilePath====', fullFilePath) - Logger.warn(this, 'tempFilePath====', tempFilePath) - // jsb.fileUtils.removeFile(tempFilePath); - Logger.warn( - this, - 'ERROR_UPDATING=============', - event.getAssetId(), - event.getMessage() - ) - this.failUpdate() - break - default: - // this.failUpdate(); - return - } - } + private jumpToPack() { + let url: string + if (sys.isNative) { + if (sys.os == sys.OS.ANDROID) { + url = VersionManager.instance.apkStoreUrl + } else if (sys.os == sys.OS.IOS) { + url = VersionManager.instance.iosStoreUrl + } + } + Logger.info( + this, + 'jumpToPack==androidurl===', + VersionManager.instance.apkStoreUrl + ) + Logger.info( + this, + 'jumpToPack==iosStoreUrl===', + VersionManager.instance.iosStoreUrl + ) + Logger.info(this, 'jumpToPack=====', url) + sys.openURL(url) + // cc.game.end(); + } - public checkUpdate() { - if (this.isUpdating || this.isCheck) { - Logger.log(this, 'Checking or updating ...') - return - } - let hotupdateUrlKey: string = - VersionManager.Config_Url_Key[this.hotupdateIndex] - Logger.log(this, 'checkoutUpdate=====', this.manifestUrl, hotupdateUrlKey) - if (!this._am) { - this._am = new native.AssetsManager( - '', - this.storagePath, - this.versionCompareHandle.bind(this) - ) - } - // this._am.setMaxConcurrentTask(1); - let manifestStr: string = ManifestConfig.getManifestStr(hotupdateUrlKey) - Logger.log(this, 'checkUpdate=======manifestStr=======', manifestStr) - let manifest = new native.Manifest(manifestStr, this.storagePath) - this._am.setVerifyCallback(function (filePath, asset) { - return true - // var md5 = calculateMD5(filePath); - // if (md5 === asset.md5) - // return true; - // else - // return false; - }) - this._am.setEventCallback(this.checkCb.bind(this)) - // 设置事件回调 - this.isCheck = true - this._am.loadLocalManifest(manifest, this.storagePath) - this._am.checkUpdate() - } + //显示强制更新,即更细包面板 + private showPackUpdateDialog() { + CommonTips.showMsg( + '有新的版本需要更新,下载后请先卸载,以前的版本,再安装!' + ) + this.jumpToPack() + this.showPackUpdateDialog() + } - /** - * @param versionA 本地版本 1.0.0 - * @param versionB 服务器版本 1.0.1 - * @param return -1需要更新 不用更新 - */ - private versionCompareHandle(versionA, versionB) { - var vA = versionA.split('.') - var vB = versionB.split('.') - Logger.log( - this, - 'versionCompareHandle======', - this.key, - VersionManager.Config_Key[0] - ) - if (this.key == VersionManager.Config_Key[0]) { - Logger.log(this, 'versionCompareHandle22===', versionA, versionB) - VersionManager.instance.nowVersion = versionA - VersionManager.instance.targetVersion = versionB - } - this.localBigVersion = parseInt(vA[0]) - this.remoteBigVersion = parseInt(vB[0]) - for (var i = 0; i < vA.length; ++i) { - var a = parseInt(vA[i]) - var b = parseInt(vB[i] || 0) - if (a === b) { - continue - } else { - return a - b - } - } - if (vB.length > vA.length) { - return -1 - } else { - return 0 - } - } + private checkCb(event: any) { + Logger.log(this, 'checkCb Code: =================' + event.getEventCode()) + switch (event.getEventCode()) { + case native.EventAssetsManager.ERROR_NO_LOCAL_MANIFEST: + Logger.info(this, 'No local manifest file found, hot update skipped.') + this.failUpdate() + break + case native.EventAssetsManager.ERROR_DOWNLOAD_MANIFEST: + case native.EventAssetsManager.ERROR_PARSE_MANIFEST: + Logger.info(this, 'Fail to download manifest file, hot update skipped.') + this.failUpdate() + break + case native.EventAssetsManager.ALREADY_UP_TO_DATE: + Logger.info(this, 'Already up to date with the latest remote version.') + this.alreadyUpToDate() + break + case native.EventAssetsManager.NEW_VERSION_FOUND: + Logger.info( + this, + 'new version found, please try to update.', + this.localBigVersion, + this.remoteBigVersion + ) + if ( + this.key == VersionManager.Config_Key[0] && + this.localBigVersion < this.remoteBigVersion + ) { + //更新大版本 + Logger.info( + this, + 'new version found, please try to update======packupdate=', + this.localBigVersion, + this.remoteBigVersion + ) + this.showPackUpdateDialog() + } else { + Logger.info( + this, + 'new version found, please try to update======hotupdate=', + this.localBigVersion, + this.remoteBigVersion + ) + // this._am.update(); + this.needUpdate = true + EventManager.instance.dispatchEvent( + HotUpdate.Event_On_NeedUpdate, + this.key + ) + } + break + case native.EventAssetsManager.UPDATE_PROGRESSION: + // var currentPercent = event.getPercent(); + // var totalPercent = event.getPercentByFile(); + // var fileprocess = event.getDownloadedFiles() + ' / ' + event.getTotalFiles(); + // var byteprocess = event.getDownloadedBytes() + ' / ' + event.getTotalBytes(); + Logger.info( + this, + 'UPDATE_PROGRESSION2222==========', + this.key, + event.getDownloadedBytes(), + event.getTotalBytes() + ) + if (event.getTotalBytes() > 0) { + EventManager.instance.dispatchEvent( + HotUpdate.Event_On_Progress, + event.getDownloadedBytes(), + event.getTotalBytes(), + this.key + ) + } + break + case native.EventAssetsManager.UPDATE_FINISHED: + Logger.info(this, 'UPDATE_FINISHED==============') + this.finishUpdate(true) + break + case native.EventAssetsManager.UPDATE_FAILED: + Logger.warn(this, 'Update failed==========', event.getMessage()) + this.failUpdate() + break + case native.EventAssetsManager.ERROR_UPDATING: + let fullFilePath: string = this.storagePath + '/' + event.getAssetId() + let tempFilePath: string = + this.storagePath + '_temp/' + event.getAssetId() + Logger.warn(this, 'fullFilePath====', fullFilePath) + Logger.warn(this, 'tempFilePath====', tempFilePath) + // jsb.fileUtils.removeFile(tempFilePath); + Logger.warn( + this, + 'ERROR_UPDATING=============', + event.getAssetId(), + event.getMessage() + ) + this.failUpdate() + break + default: + // this.failUpdate(); + return + } + } - public startUpdate() { - if (this.isUpdating) return - let localManifest = this._am.getLocalManifest() - let remoteManifest = this._am.getRemoteManifest() - Logger.log(this, 'startUpdate111===', localManifest.getVersionFileUrl()) - Logger.log(this, 'startUpdate2222===', localManifest.getManifestFileUrl()) - Logger.log(this, 'startUpdate3333===', remoteManifest.getVersionFileUrl()) - Logger.log(this, 'startUpdate4444===', remoteManifest.getManifestFileUrl()) - this.isUpdating = true - EventManager.instance.dispatchEvent( - HotUpdate.Event_On_Progress, - 0, - 100, - this.key - ) - this._am.update() - } + public checkUpdate() { + if (this.isUpdating || this.isCheck) { + Logger.log(this, 'Checking or updating ...') + return + } + let hotupdateUrlKey: string = + VersionManager.Config_Url_Key[this.hotupdateIndex] + Logger.log(this, 'checkoutUpdate=====', this.manifestUrl, hotupdateUrlKey) + if (!this._am) { + this._am = new native.AssetsManager( + '', + this.storagePath, + this.versionCompareHandle.bind(this) + ) + } + // this._am.setMaxConcurrentTask(1); + let manifestStr: string = ManifestConfig.getManifestStr(hotupdateUrlKey) + Logger.log(this, 'checkUpdate=======manifestStr=======', manifestStr) + let manifest = new native.Manifest(manifestStr, this.storagePath) + this._am.setVerifyCallback(function(filePath, asset) { + return true + // var md5 = calculateMD5(filePath); + // if (md5 === asset.md5) + // return true; + // else + // return false; + }) + this._am.setEventCallback(this.checkCb.bind(this)) + // 设置事件回调 + this.isCheck = true + this._am.loadLocalManifest(manifest, this.storagePath) + this._am.checkUpdate() + } - public disposeUpdate() { - if (this._am) { - this._am.setVerifyCallback(null) - this._am.setEventCallback(null) - } - this._am = null - this._checkListener = null - this.isUpdating = false - this.needUpdate = false - } + /** + * @param versionA 本地版本 1.0.0 + * @param versionB 服务器版本 1.0.1 + */ + private versionCompareHandle(versionA: string, versionB: string) { + const vA = versionA.split('.') + const vB = versionB.split('.') + Logger.log( + this, + 'versionCompareHandle======', + this.key, + VersionManager.Config_Key[0] + ) + if (this.key == VersionManager.Config_Key[0]) { + Logger.log(this, 'versionCompareHandle22===', versionA, versionB) + VersionManager.instance.nowVersion = versionA + VersionManager.instance.targetVersion = versionB + } + this.localBigVersion = parseInt(vA[0]) + this.remoteBigVersion = parseInt(vB[0]) + for (let i = 0; i < vA.length; ++i) { + const a = parseInt(vA[i]) + const b = parseInt(vB[i] || '0') + if (a !== b) return a - b + } + if (vB.length > vA.length) { + return -1 + } else { + return 0 + } + } - private failUpdate() { - this.disposeUpdate() - this.isCheck = false - EventManager.instance.dispatchEvent( - HotUpdate.Event_On_Fail_Update, - this.key - ) - } + public startUpdate() { + if (this.isUpdating) return + let localManifest = this._am.getLocalManifest() + let remoteManifest = this._am.getRemoteManifest() + Logger.log(this, 'startUpdate111===', localManifest.getVersionFileUrl()) + Logger.log(this, 'startUpdate2222===', localManifest.getManifestFileUrl()) + Logger.log(this, 'startUpdate3333===', remoteManifest.getVersionFileUrl()) + Logger.log(this, 'startUpdate4444===', remoteManifest.getManifestFileUrl()) + this.isUpdating = true + EventManager.instance.dispatchEvent( + HotUpdate.Event_On_Progress, + 0, + 100, + this.key + ) + this._am.update() + } - private alreadyUpToDate() { - this.disposeUpdate() - this.isFinishUpdate = true - EventManager.instance.dispatchEvent( - HotUpdate.Event_On_ALREADY_UP_TO_DATE, - this.key - ) - } + public disposeUpdate() { + if (this._am) { + this._am.setVerifyCallback(null) + this._am.setEventCallback(null) + } + this._am = null + this._checkListener = null + this.isUpdating = false + this.needUpdate = false + } - private finishUpdate(needRestart: boolean) { - Logger.info(this, '更新完成=====', needRestart) - this.disposeUpdate() - this.isFinishUpdate = true - EventManager.instance.dispatchEvent( - HotUpdate.Event_Finish_Update, - this.key, - needRestart - ) - if (false && needRestart) { - //暂时不想修 fileUtils 这个报错 - var searchPaths = '' //jsb.fileUtils.getSearchPaths();暂时注释 - Logger.info(this, '更新完成====searchPaths======', searchPaths) - sys.localStorage.setItem( - 'HotUpdateSearchPaths', - JSON.stringify(searchPaths) - ) - //jsb.fileUtils.setSearchPaths(searchPaths);暂时注释 - if (this.key == VersionManager.Config_Key[0]) { - ResourcePreload.instance.restartGame() - } - } - } + private failUpdate() { + this.disposeUpdate() + this.isCheck = false + EventManager.instance.dispatchEvent( + HotUpdate.Event_On_Fail_Update, + this.key + ) + } + + private alreadyUpToDate() { + this.disposeUpdate() + this.isFinishUpdate = true + EventManager.instance.dispatchEvent( + HotUpdate.Event_On_ALREADY_UP_TO_DATE, + this.key + ) + } + + private finishUpdate(needRestart: boolean) { + Logger.info(this, '更新完成=====', needRestart) + this.disposeUpdate() + this.isFinishUpdate = true + EventManager.instance.dispatchEvent( + HotUpdate.Event_Finish_Update, + this.key, + needRestart + ) + if (false && needRestart) { + //暂时不想修 fileUtils 这个报错 + var searchPaths = '' //jsb.fileUtils.getSearchPaths();暂时注释 + Logger.info(this, '更新完成====searchPaths======', searchPaths) + sys.localStorage.setItem( + 'HotUpdateSearchPaths', + JSON.stringify(searchPaths) + ) + //jsb.fileUtils.setSearchPaths(searchPaths);暂时注释 + if (this.key == VersionManager.Config_Key[0]) { + ResourcePreload.instance.restartGame() + } + } + } } diff --git a/assets/FishSingle/script/engine/utils/HttpClient.ts b/assets/FishSingle/script/engine/utils/HttpClient.ts index 6f81095..4ed22d2 100644 --- a/assets/FishSingle/script/engine/utils/HttpClient.ts +++ b/assets/FishSingle/script/engine/utils/HttpClient.ts @@ -1,160 +1,160 @@ import { _decorator } from 'cc' -const { ccclass } = _decorator - -import LoadingPrefab from '../uicomponent/LoadingPrefab' -import VersionManager from './VersionManager' import { Logger } from './Logger' +const { ccclass } = _decorator + @ccclass('HttpClient') export default class HttpClient { - public static instance: HttpClient //= new HttpClient(); + public static instance: HttpClient //= new HttpClient(); - //example - // HttpClient.instance.request("http://localhost:8080/haohttp/test", ()=>{ - // console.log("http 请求 end============="); - // }, {"nickName":"jhao", "hh":1, "id":9527}); + //example + // HttpClient.instance.request("http://localhost:8080/haohttp/test", ()=>{ + // console.log("http 请求 end============="); + // }, {"nickName":"jhao", "hh":1, "id":9527}); - private methodType: string = 'GET' + private methodType: string = 'GET' - private responseType: XMLHttpRequestResponseType = 'json' + private responseType: XMLHttpRequestResponseType = 'json' - private xhr: XMLHttpRequest + private xhr: XMLHttpRequest - // --GET or POST - public setMethod(method: string = 'GET') { - this.methodType = method - } + // --GET or POST + public setMethod(method: string = 'GET') { + this.methodType = method + } - public setParams(paramsObj: object): string { - let resParams = '' - let nowIndex = 1 - for (const key in paramsObj) { - if (paramsObj.hasOwnProperty(key)) { - if (nowIndex == 1) { - resParams += key + '=' + paramsObj[key] - } else { - resParams += '&' + key + '=' + paramsObj[key] - } - nowIndex += 1 - } - } - Logger.log(this, 'resParam===============', resParams) - return resParams - } + public setParams(paramsObj: object): string { + let resParams = '' + let nowIndex = 1 + for (const key in paramsObj) { + if (paramsObj.hasOwnProperty(key)) { + if (nowIndex == 1) { + resParams += key + '=' + paramsObj[key] + } else { + resParams += '&' + key + '=' + paramsObj[key] + } + nowIndex += 1 + } + } + Logger.log(this, 'resParam===============', resParams) + return resParams + } - public setResponseType(responseType: XMLHttpRequestResponseType) { - this.responseType = responseType - } + public setResponseType(responseType: XMLHttpRequestResponseType) { + this.responseType = responseType + } - public setContentType() {} + public setContentType() { + } - public request( - url: string, - callback: Function, - params: any = null, - timeOut: number = 5 * 1000 - ) { - if (params && this.methodType == 'GET') { - let getParams: string = this.setParams(params) - // getParams = StringUtil:encodeURI(params) - getParams = encodeURI(getParams) - url += '?' + getParams - } - this.xhr = new XMLHttpRequest() // http请求 fget - //this.xhr = cc.loader.getXMLHttpRequest(); - let xhr: XMLHttpRequest = this.xhr - xhr.responseType = this.responseType - xhr.timeout = timeOut - // xhr.setRequestHeader("Content-Type", "text/plain"); - xhr.onreadystatechange = () => { - Logger.log( - this, - 'status======', - xhr.status, - xhr.readyState, - xhr.statusText - ) - // if (xhr.readyState == 4 && (xhr.status >= 200 && xhr.status < 400)) { - if (xhr.readyState == 4 && xhr.status == 200) { - let response = xhr.response - Logger.log(this, 'http response1============', xhr) - try { - let testJson = JSON.stringify(response) - Logger.log(this, 'http response json============', testJson) - if (callback) { - callback(true, response) - callback = null - } - } catch (error) { - Logger.error(this, 'http response json=====error=======', error) - if (callback) { - callback(false) - callback = null - } - } - } else if (xhr.readyState == 4 && xhr.status == 301) { - //域名转移 - Logger.log( - this, - 'http response222============', - xhr.getResponseHeader('Location') - ) - // console.log("http response333============", xhr.getAllResponseHeaders()); - if (HttpClient.instance == null) HttpClient.instance = new HttpClient() - HttpClient.instance.request(xhr.getResponseHeader('Location'), callback) - } else if (xhr.readyState == 4 && xhr.status == 404) { - Logger.log(this, 'http onError============') - if (callback) { - callback(false) - callback = null - } - } else { - Logger.log( - this, - 'onreadystatechange else====', - xhr.status, - xhr.readyState, - xhr.response - ) - if (xhr.readyState == 4) { - Logger.log(this, 'http onError else============') - if (callback) { - callback(false) - callback = null - } - } - } - } - xhr.onprogress = () => { - Logger.log( - this, - 'http onprogress===', - xhr.status, - xhr.readyState, - xhr.response - ) - } - xhr.onerror = () => { - Logger.log(this, 'http onError============') - if (callback) { - callback(false) - callback = null - } - } - xhr.ontimeout = () => { - Logger.log(this, 'http ontimeout============') - if (callback) { - callback(false) - callback = null - } - } - Logger.log(this, 'http request==============', url) - Logger.log(this, 'http request======method========', this.methodType) - Logger.log(this, 'http request======params========', params) - xhr.open(this.methodType, url, true) - xhr.setRequestHeader('content-type', 'text/plain;charset=UTF-8') - xhr.send(params) - } + public request( + url: string, + callback: Function, + params: any = null, + timeOut: number = 5 * 1000 + ) { + if (params && this.methodType == 'GET') { + let getParams: string = this.setParams(params) + // getParams = StringUtil:encodeURI(params) + getParams = encodeURI(getParams) + url += '?' + getParams + } + this.xhr = new XMLHttpRequest() // http请求 fget + //this.xhr = cc.loader.getXMLHttpRequest(); + let xhr: XMLHttpRequest = this.xhr + xhr.responseType = this.responseType + xhr.timeout = timeOut + // xhr.setRequestHeader("Content-Type", "text/plain"); + xhr.onreadystatechange = () => { + Logger.log( + this, + 'status======', + xhr.status, + xhr.readyState, + xhr.statusText + ) + // if (xhr.readyState == 4 && (xhr.status >= 200 && xhr.status < 400)) { + if (xhr.readyState == 4 && xhr.status == 200) { + let response = xhr.response + Logger.log(this, 'http response1============', xhr) + try { + let testJson = JSON.stringify(response) + Logger.log(this, 'http response json============', testJson) + if (callback) { + callback(true, response) + callback = null + } + } catch (error) { + Logger.error(this, 'http response json=====error=======', error) + if (callback) { + callback(false) + callback = null + } + } + } else if (xhr.readyState == 4 && xhr.status == 301) { + //域名转移 + Logger.log( + this, + 'http response222============', + xhr.getResponseHeader('Location') + ) + // console.log("http response333============", xhr.getAllResponseHeaders()); + if (HttpClient.instance == null) HttpClient.instance = new HttpClient() + HttpClient.instance.request(xhr.getResponseHeader('Location'), callback) + } else if (xhr.readyState == 4 && xhr.status == 404) { + Logger.log(this, 'http onError============') + if (callback) { + callback(false) + callback = null + } + } else { + Logger.log( + this, + 'onreadystatechange else====', + xhr.status, + xhr.readyState, + xhr.response + ) + if (xhr.readyState == 4) { + Logger.log(this, 'http onError else============') + if (callback) { + callback(false) + callback = null + } + } + } + } + xhr.onprogress = () => { + Logger.log( + this, + 'http onprogress===', + xhr.status, + xhr.readyState, + xhr.response + ) + } + xhr.onerror = () => { + Logger.log(this, 'http onError============') + if (callback) { + callback(false) + callback = null + } + } + xhr.ontimeout = () => { + Logger.log(this, 'http ontimeout============') + if (callback) { + callback(false) + callback = null + } + } + Logger.log(this, 'http request==============', url) + Logger.log(this, 'http request======method========', this.methodType) + Logger.log(this, 'http request======params========', params) + xhr.open(this.methodType, url, true) + xhr.setRequestHeader('content-type', 'text/plain;charset=UTF-8') + xhr.send(params) + } - public getInfo(callback: Function = null) {} + public getInfo(callback: Function = null) { + } } diff --git a/assets/FishSingle/script/engine/utils/LocalStorage.ts b/assets/FishSingle/script/engine/utils/LocalStorage.ts index bb87531..3cf2f3b 100644 --- a/assets/FishSingle/script/engine/utils/LocalStorage.ts +++ b/assets/FishSingle/script/engine/utils/LocalStorage.ts @@ -1,64 +1,63 @@ -import { sys, _decorator } from 'cc' -import { Logger } from './Logger' +import { sys } from 'cc' export default class LocalStorage { - public static GamePreFlag: string = 'fengshen-game-HaoLocalStorage' + public static GamePreFlag: string = 'fengshen-game-HaoLocalStorage' - public static setItem(key: string, value: string): void { - sys.localStorage.setItem(LocalStorage.GamePreFlag + key, value) - } + public static setItem(key: string, value: string): void { + sys.localStorage.setItem(LocalStorage.GamePreFlag + key, value) + } - public static getItem(key: string): string { - return sys.localStorage.getItem(LocalStorage.GamePreFlag + key) - } + public static getItem(key: string): string { + return sys.localStorage.getItem(LocalStorage.GamePreFlag + key) + } - public static removeItem(key: string): void { - sys.localStorage.removeItem(LocalStorage.GamePreFlag + key) - } + public static removeItem(key: string): void { + sys.localStorage.removeItem(LocalStorage.GamePreFlag + key) + } - public static getInt(key: string): number { - let tempValue: string = LocalStorage.getItem(key) - let result: number = 0 - if (tempValue) { - result = parseInt(tempValue) - } - return result - } + public static getInt(key: string): number { + let tempValue: string = LocalStorage.getItem(key) + let result: number = 0 + if (tempValue) { + result = parseInt(tempValue) + } + return result + } - public static setInt(key: string, value: number): void { - LocalStorage.setItem(key, value.toString()) - } + public static setInt(key: string, value: number): void { + LocalStorage.setItem(key, value.toString()) + } - public static getFloat(key: string): number { - let tempValue: string = LocalStorage.getItem(key) - let result: number = 0 - if (tempValue) { - result = parseFloat(tempValue) - } - return result - } + public static getFloat(key: string): number { + let tempValue: string = LocalStorage.getItem(key) + let result: number = 0 + if (tempValue) { + result = parseFloat(tempValue) + } + return result + } - public static setFloat(key: string, value: number): void { - LocalStorage.setItem(key, value.toString()) - } + public static setFloat(key: string, value: number): void { + LocalStorage.setItem(key, value.toString()) + } - public static getBoolean(key: string): boolean { - let temp: number = LocalStorage.getInt(key) - if (temp == 1) { - return true - } - return false - } + public static getBoolean(key: string): boolean { + let temp: number = LocalStorage.getInt(key) + if (temp == 1) { + return true + } + return false + } - public static setBoolean(key: string, value: boolean) { - if (value) { - LocalStorage.setInt(key, 1) - } else { - LocalStorage.setInt(key, 0) - } - } + public static setBoolean(key: string, value: boolean) { + if (value) { + LocalStorage.setInt(key, 1) + } else { + LocalStorage.setInt(key, 0) + } + } - public static clear() { - sys.localStorage.clear() - } + public static clear() { + sys.localStorage.clear() + } } diff --git a/assets/FishSingle/script/engine/utils/Logger.ts b/assets/FishSingle/script/engine/utils/Logger.ts index ca1e258..bf592a3 100644 --- a/assets/FishSingle/script/engine/utils/Logger.ts +++ b/assets/FishSingle/script/engine/utils/Logger.ts @@ -1,133 +1,138 @@ -import { error, _decorator } from 'cc' class LOG_LEVEL_TYPES { - public static DEBUG = 0 - public static LOG = 1 - public static INFO = 2 - public static WARN = 3 - public static ERROR = 4 + public static DEBUG = 0 + public static LOG = 1 + public static INFO = 2 + public static WARN = 3 + public static ERROR = 4 } + const Log_Level_Names: Array = ['debug', 'log', 'info', 'warn', 'error'] export class Logger { - public static tag: string = '[HaoJslog]' //可以设置当前游戏的前缀 - public static LEVEL: number = LOG_LEVEL_TYPES.WARN //当前Logger等级 - public static Log_Color_Config: Array = [ - 'color:#890;font-size:10px;', - 'color:#000;font-size:11px;', - 'color:#09f;font-size:12px;', - 'color:#f90;font-size:13px;', - 'color:#f00;font-size:15px;', - ] - private static Terminal_Log: boolean = false - public static formatNow() { - let date: Date = new Date() //后端返回的时间戳是秒 - return ( - date.getFullYear() + - '-' + - (date.getMonth() + 1) + - '-' + - date.getDate() + - ' ' + - date.getHours() + - ':' + - date.getMinutes() + - ':' + - date.getSeconds() + - ':' + - date.getMilliseconds() - ) - } - private static getLogPreKey(nowLevel: number): string { - let str: string = - '[' + - Logger.formatNow() + - '] ' + - Logger.tag + - ' [' + - Log_Level_Names[nowLevel] + - '] ' - return str - } - public static debug(...params: any) { - if (Logger.LEVEL > LOG_LEVEL_TYPES.DEBUG) { - return - } - let str: string = this.getLogPreKey(LOG_LEVEL_TYPES.DEBUG) - let fileStr: string = str + params.join(' ') - // LogErrorFileUtil.debug(fileStr); - if (this.Terminal_Log) { - console.log( - '%c' + str, - this.Log_Color_Config[LOG_LEVEL_TYPES.DEBUG], - ...params - ) - } else { - console.info(fileStr) - } - } - public static log(...params: any) { - if (Logger.LEVEL > LOG_LEVEL_TYPES.LOG) { - return - } - let str: string = this.getLogPreKey(LOG_LEVEL_TYPES.LOG) - let fileStr: string = str + params.join(' ') - // LogErrorFileUtil.log(fileStr); - if (this.Terminal_Log) { - console.log( - '%c' + str, - this.Log_Color_Config[LOG_LEVEL_TYPES.DEBUG], - ...params - ) - } else { - console.info(fileStr) //console.log(str, ...params) - } - } - public static info(...params: any) { - if (Logger.LEVEL > LOG_LEVEL_TYPES.INFO) { - return - } - let str: string = this.getLogPreKey(LOG_LEVEL_TYPES.INFO) - let fileStr: string = str + params.join(' ') - if (this.Terminal_Log) { - console.info( - '%c' + str, - this.Log_Color_Config[LOG_LEVEL_TYPES.DEBUG], - ...params - ) - } else { - console.info(fileStr) - } - } - public static warn(...params: any) { - if (Logger.LEVEL > LOG_LEVEL_TYPES.WARN) { - return - } - let str: string = this.getLogPreKey(LOG_LEVEL_TYPES.WARN) - let fileStr: string = str + params.join(' ') - if (this.Terminal_Log) { - console.warn( - '%c' + str, - this.Log_Color_Config[LOG_LEVEL_TYPES.DEBUG], - ...params - ) - } else { - console.warn(fileStr) - } - } - public static error(...params: any) { - if (Logger.LEVEL > LOG_LEVEL_TYPES.ERROR) { - return - } - let str: string = this.getLogPreKey(LOG_LEVEL_TYPES.ERROR) - let fileStr: string = str + params.join(' ') - if (this.Terminal_Log) { - console.error( - '%c' + str, - this.Log_Color_Config[LOG_LEVEL_TYPES.DEBUG], - ...params - ) - } else { - console.error(fileStr) - } - } + public static tag: string = '[HaoJslog]' //可以设置当前游戏的前缀 + public static LEVEL: number = LOG_LEVEL_TYPES.WARN //当前Logger等级 + public static Log_Color_Config: Array = [ + 'color:#890;font-size:10px;', + 'color:#000;font-size:11px;', + 'color:#09f;font-size:12px;', + 'color:#f90;font-size:13px;', + 'color:#f00;font-size:15px;' + ] + private static Terminal_Log: boolean = false + + public static formatNow() { + let date: Date = new Date() //后端返回的时间戳是秒 + return ( + date.getFullYear() + + '-' + + (date.getMonth() + 1) + + '-' + + date.getDate() + + ' ' + + date.getHours() + + ':' + + date.getMinutes() + + ':' + + date.getSeconds() + + ':' + + date.getMilliseconds() + ) + } + + private static getLogPreKey(nowLevel: number): string { + return '[' + + Logger.formatNow() + + '] ' + + Logger.tag + + ' [' + + Log_Level_Names[nowLevel] + + '] ' + } + + public static debug(...params: any) { + if (Logger.LEVEL > LOG_LEVEL_TYPES.DEBUG) { + return + } + let str: string = this.getLogPreKey(LOG_LEVEL_TYPES.DEBUG) + let fileStr: string = str + params.join(' ') + // LogErrorFileUtil.debug(fileStr); + if (this.Terminal_Log) { + console.log( + '%c' + str, + this.Log_Color_Config[LOG_LEVEL_TYPES.DEBUG], + ...params + ) + } else { + console.info(fileStr) + } + } + + public static log(...params: any) { + if (Logger.LEVEL > LOG_LEVEL_TYPES.LOG) { + return + } + let str: string = this.getLogPreKey(LOG_LEVEL_TYPES.LOG) + let fileStr: string = str + params.join(' ') + // LogErrorFileUtil.log(fileStr); + if (this.Terminal_Log) { + console.log( + '%c' + str, + this.Log_Color_Config[LOG_LEVEL_TYPES.DEBUG], + ...params + ) + } else { + console.info(fileStr) //console.log(str, ...params) + } + } + + public static info(...params: any) { + if (Logger.LEVEL > LOG_LEVEL_TYPES.INFO) { + return + } + let str: string = this.getLogPreKey(LOG_LEVEL_TYPES.INFO) + let fileStr: string = str + params.join(' ') + if (this.Terminal_Log) { + console.info( + '%c' + str, + this.Log_Color_Config[LOG_LEVEL_TYPES.DEBUG], + ...params + ) + } else { + console.info(fileStr) + } + } + + public static warn(...params: any) { + if (Logger.LEVEL > LOG_LEVEL_TYPES.WARN) { + return + } + let str: string = this.getLogPreKey(LOG_LEVEL_TYPES.WARN) + let fileStr: string = str + params.join(' ') + if (this.Terminal_Log) { + console.warn( + '%c' + str, + this.Log_Color_Config[LOG_LEVEL_TYPES.DEBUG], + ...params + ) + } else { + console.warn(fileStr) + } + } + + public static error(...params: any) { + if (Logger.LEVEL > LOG_LEVEL_TYPES.ERROR) { + return + } + let str: string = this.getLogPreKey(LOG_LEVEL_TYPES.ERROR) + let fileStr: string = str + params.join(' ') + if (this.Terminal_Log) { + console.error( + '%c' + str, + this.Log_Color_Config[LOG_LEVEL_TYPES.DEBUG], + ...params + ) + } else { + console.error(fileStr) + } + } } diff --git a/assets/FishSingle/script/engine/utils/MathUtils.ts b/assets/FishSingle/script/engine/utils/MathUtils.ts index c7a8d62..f73dfff 100644 --- a/assets/FishSingle/script/engine/utils/MathUtils.ts +++ b/assets/FishSingle/script/engine/utils/MathUtils.ts @@ -1,61 +1,64 @@ -import { _decorator, Vec2 } from 'cc' +import { Vec2 } from 'cc' + export default class MathUtils { - /** - * 2个点之前的直线距离 - * @param p1 - * @param p2 - */ - public static distance(x1: number, y1: number, x2: number, y2: number) { - // 设两点A(X1,Y1),B(X2,Y2) - // 距离D=(X2-X1)的平方+(Y2-Y1)平方的和开平方 - return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2)) - } + /** + * 2个点之前的直线距离 + * @param x1 + * @param y1 + * @param x2 + * @param y2 + */ + public static distance(x1: number, y1: number, x2: number, y2: number) { + // 设两点A(X1,Y1),B(X2,Y2) + // 距离D=(X2-X1)的平方+(Y2-Y1)平方的和开平方 + return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2)) + } - /** - * 2点间的向量 - * @param p1 - * @param p2 - */ - public static sub(p1: Vec2, p2: Vec2) { - return new Vec2(p1.x - p2.x, p1.y - p2.y) - } + /** + * 2点间的向量 + * @param p1 + * @param p2 + */ + public static sub(p1: Vec2, p2: Vec2) { + return new Vec2(p1.x - p2.x, p1.y - p2.y) + } - /** - * 弧度转角度 - * @param radians - */ - public static radiansToDegrees(radians: number) { - return (180 / Math.PI) * radians - } + /** + * 弧度转角度 + * @param radians + */ + public static radiansToDegrees(radians: number) { + return (180 / Math.PI) * radians + } - /** - * 角度转弧度 - * @param degrees - */ - public static degreesToRadians(degrees: number) { - return (Math.PI * degrees) / 180 - } + /** + * 角度转弧度 + * @param degrees + */ + public static degreesToRadians(degrees: number) { + return (Math.PI * degrees) / 180 + } - /** - * 返回2点间的弧度 - * @param startP - * @param endP - */ - public static p2pRad(startP: Vec2, endP: Vec2) { - let rad: number = Math.atan2(endP.y - startP.y, endP.x - startP.x) - return rad - } + /** + * 返回2点间的弧度 + * @param startP + * @param endP + */ + public static p2pRad(startP: Vec2, endP: Vec2) { + let rad: number = Math.atan2(endP.y - startP.y, endP.x - startP.x) + return rad + } - /** - * 针对捕鱼鱼的方向特定实现的鱼方向转换 - * @param rot - */ - public static rotation2Fish(rot: number) { - if (rot >= 0 && rot <= 180) { - rot = 180 - rot - } else { - rot = -180 - rot - } - return rot - } + /** + * 针对捕鱼鱼的方向特定实现的鱼方向转换 + * @param rot + */ + public static rotation2Fish(rot: number) { + if (rot >= 0 && rot <= 180) { + rot = 180 - rot + } else { + rot = -180 - rot + } + return rot + } } diff --git a/assets/FishSingle/script/engine/utils/MoveHelper.ts b/assets/FishSingle/script/engine/utils/MoveHelper.ts index ee7cde5..e033574 100644 --- a/assets/FishSingle/script/engine/utils/MoveHelper.ts +++ b/assets/FishSingle/script/engine/utils/MoveHelper.ts @@ -1,62 +1,62 @@ -import { _decorator, Node, Vec3, Vec2 } from 'cc' -import { Logger } from './Logger' +import { Node, Vec2, Vec3 } from 'cc' import MathUtils from './MathUtils' export class MoveHelper { - public static _vec3: Vec3 = new Vec3() - public static _vec2_0: Vec2 = new Vec2() - public static _vec2_1: Vec2 = new Vec2() - public static moveNode( - moveNode: Node, - speed: number, - tx: number, - ty: number, - minSpeed: number = 0.01 - ) { - let isMoving: boolean = false - let times: number = 0 - moveNode.getPosition(MoveHelper._vec3) - MoveHelper._vec2_0.x = MoveHelper._vec3.x - MoveHelper._vec2_0.y = MoveHelper._vec3.y - MoveHelper._vec2_1.x = tx - MoveHelper._vec2_1.y = ty - let rad: number = MathUtils.p2pRad(MoveHelper._vec2_0, MoveHelper._vec2_1) - let speedX: number = speed * Math.cos(rad) - let speedY: number = speed * Math.sin(rad) - if (Math.abs(MoveHelper._vec3.x - tx) > minSpeed) { - times = Math.floor(Math.abs(speedX / minSpeed)) - for (let i = 0; i < times; i++) { - if (MoveHelper._vec3.x > tx) { - MoveHelper._vec3.x -= minSpeed - moveNode.setPosition(MoveHelper._vec3) - } else { - MoveHelper._vec3.x += minSpeed - moveNode.setPosition(MoveHelper._vec3) - } - if (Math.abs(MoveHelper._vec3.x - tx) <= minSpeed * 2) { - MoveHelper._vec3.x = tx - moveNode.setPosition(MoveHelper._vec3) - } - } - isMoving = true - } - if (Math.abs(MoveHelper._vec3.y - ty) > minSpeed) { - times = Math.floor(Math.abs(speedY / minSpeed)) - for (let j = 0; j < times; j++) { - if (MoveHelper._vec3.y > ty) { - MoveHelper._vec3.y -= minSpeed - moveNode.setPosition(MoveHelper._vec3) - } else { - MoveHelper._vec3.y += minSpeed - moveNode.setPosition(MoveHelper._vec3) - } - if (Math.abs(MoveHelper._vec3.x - ty) <= minSpeed * 2) { - MoveHelper._vec3.y = ty - moveNode.setPosition(MoveHelper._vec3) - } - } - isMoving = true - } - return isMoving - } + public static _vec3: Vec3 = new Vec3() + public static _vec2_0: Vec2 = new Vec2() + public static _vec2_1: Vec2 = new Vec2() + + public static moveNode( + moveNode: Node, + speed: number, + tx: number, + ty: number, + minSpeed: number = 0.01 + ) { + let isMoving: boolean = false + let times: number = 0 + moveNode.getPosition(MoveHelper._vec3) + MoveHelper._vec2_0.x = MoveHelper._vec3.x + MoveHelper._vec2_0.y = MoveHelper._vec3.y + MoveHelper._vec2_1.x = tx + MoveHelper._vec2_1.y = ty + let rad: number = MathUtils.p2pRad(MoveHelper._vec2_0, MoveHelper._vec2_1) + let speedX: number = speed * Math.cos(rad) + let speedY: number = speed * Math.sin(rad) + if (Math.abs(MoveHelper._vec3.x - tx) > minSpeed) { + times = Math.floor(Math.abs(speedX / minSpeed)) + for (let i = 0; i < times; i++) { + if (MoveHelper._vec3.x > tx) { + MoveHelper._vec3.x -= minSpeed + moveNode.setPosition(MoveHelper._vec3) + } else { + MoveHelper._vec3.x += minSpeed + moveNode.setPosition(MoveHelper._vec3) + } + if (Math.abs(MoveHelper._vec3.x - tx) <= minSpeed * 2) { + MoveHelper._vec3.x = tx + moveNode.setPosition(MoveHelper._vec3) + } + } + isMoving = true + } + if (Math.abs(MoveHelper._vec3.y - ty) > minSpeed) { + times = Math.floor(Math.abs(speedY / minSpeed)) + for (let j = 0; j < times; j++) { + if (MoveHelper._vec3.y > ty) { + MoveHelper._vec3.y -= minSpeed + moveNode.setPosition(MoveHelper._vec3) + } else { + MoveHelper._vec3.y += minSpeed + moveNode.setPosition(MoveHelper._vec3) + } + if (Math.abs(MoveHelper._vec3.x - ty) <= minSpeed * 2) { + MoveHelper._vec3.y = ty + moveNode.setPosition(MoveHelper._vec3) + } + } + isMoving = true + } + return isMoving + } } diff --git a/assets/FishSingle/script/engine/utils/PrefabLoader.ts b/assets/FishSingle/script/engine/utils/PrefabLoader.ts index 7767386..cd0344d 100644 --- a/assets/FishSingle/script/engine/utils/PrefabLoader.ts +++ b/assets/FishSingle/script/engine/utils/PrefabLoader.ts @@ -1,30 +1,30 @@ -import { AssetManager, Prefab, _decorator } from 'cc' -const { ccclass, property } = _decorator - +import { _decorator, AssetManager, Prefab } from 'cc' import { Logger } from './Logger' +const { ccclass, property } = _decorator + @ccclass('PrefabLoader') export default class PrefabLoader { - private static isLoading: boolean = false + private static isLoading: boolean = false - public static loadPrefab(url: string, callback: Function) { - if (this.isLoading) return - this.isLoading = true - AssetManager.instance.resources.load( - url, - Prefab, - (error: Error, loadedResource) => { - if (error) { - Logger.warn(this, '载入Prefab失败, 原因:', url, error.message) - return - } - if (!(loadedResource instanceof Prefab)) { - Logger.warn(this, '你载入的不是Prefab, 你做了什么事?') - return - } - callback(loadedResource) - this.isLoading = false - } - ) - } + public static loadPrefab(url: string, callback: Function) { + if (this.isLoading) return + this.isLoading = true + AssetManager.instance.resources.load( + url, + Prefab, + (error: Error, loadedResource) => { + if (error) { + Logger.warn(this, '载入Prefab失败, 原因:', url, error.message) + return + } + if (!(loadedResource instanceof Prefab)) { + Logger.warn(this, '你载入的不是Prefab, 你做了什么事?') + return + } + callback(loadedResource) + this.isLoading = false + } + ) + } } diff --git a/assets/FishSingle/script/engine/utils/RandomUtil.ts b/assets/FishSingle/script/engine/utils/RandomUtil.ts index 6c3d06f..e486710 100644 --- a/assets/FishSingle/script/engine/utils/RandomUtil.ts +++ b/assets/FishSingle/script/engine/utils/RandomUtil.ts @@ -1,50 +1,49 @@ -import { Vec2, _decorator } from 'cc' +import { Vec2 } from 'cc' + export default class RandomUtil { - //随机minNum到maxNum的数字 (包含maxNum) - public static nextInt(minNum: number, maxNum: number) { - return Math.floor(Math.random() * (maxNum - minNum + 1) + minNum) - } + //随机minNum到maxNum的数字 (包含maxNum) + public static nextInt(minNum: number, maxNum: number) { + return Math.floor(Math.random() * (maxNum - minNum + 1) + minNum) + } - public static nextNumber(minNum: number, maxNum: number) { - return Math.random() * (maxNum - minNum) + minNum - } + public static nextNumber(minNum: number, maxNum: number) { + return Math.random() * (maxNum - minNum) + minNum + } - public static nextSign() { - let temp = Math.random() - if (temp < 0.5) { - return 1 - } - return -1 - } + public static nextSign() { + let temp = Math.random() + if (temp < 0.5) { + return 1 + } + return -1 + } - public static nextBoolean() { - let temp = Math.random() - if (temp < 0.5) { - return true - } - return false - } + public static nextBoolean() { + let temp = Math.random() + return temp < 0.5; - public static randomArr(nowArr: Array, needNum: number) { - let tempArr: Array = nowArr.concat() - let resultArr: Array = [] - for (let index = 0; index < needNum; index++) { - if (tempArr.length <= 0) { - break - } - let randomIndex: number = RandomUtil.nextInt(0, tempArr.length - 1) - resultArr.push(tempArr.splice(randomIndex, 1)[0]) - } - return resultArr - } + } - public static randomItem(nowArr: Array) { - return this.randomArr(nowArr, 1)[0] - } + public static randomArr(nowArr: Array, needNum: number) { + let tempArr: Array = nowArr.concat() + let resultArr: Array = [] + for (let index = 0; index < needNum; index++) { + if (tempArr.length <= 0) { + break + } + let randomIndex: number = RandomUtil.nextInt(0, tempArr.length - 1) + resultArr.push(tempArr.splice(randomIndex, 1)[0]) + } + return resultArr + } - public static randomP(left: number, right: number, up: number, down: number) { - let randomX: number = RandomUtil.nextNumber(left, right) - let randomY: number = RandomUtil.nextNumber(up, down) - return new Vec2(randomX, randomY) - } + public static randomItem(nowArr: Array) { + return this.randomArr(nowArr, 1)[0] + } + + public static randomP(left: number, right: number, up: number, down: number) { + let randomX: number = RandomUtil.nextNumber(left, right) + let randomY: number = RandomUtil.nextNumber(up, down) + return new Vec2(randomX, randomY) + } } diff --git a/assets/FishSingle/script/engine/utils/ShaderHelper.ts b/assets/FishSingle/script/engine/utils/ShaderHelper.ts index b61784a..2f814e2 100644 --- a/assets/FishSingle/script/engine/utils/ShaderHelper.ts +++ b/assets/FishSingle/script/engine/utils/ShaderHelper.ts @@ -1,436 +1,428 @@ -import { - _decorator, - Node, - Material, - Color, - UIRenderer, - Vec2, - UITransform, -} from 'cc' +import { Color, Material, Node, UIRenderer, UITransform, Vec2 } from 'cc' import ShaderMaterialPrefab from '../../game/prefab/ShaderMaterialPrefab' -import { Logger } from './Logger' export default class ShaderHelper { - /** - * 清除所有shader - * @param showNode - * @param material - */ - public static clearAllEffect( - showNode: Node, - material: Material = ShaderMaterialPrefab.instance.getComponent( - ShaderMaterialPrefab - ).default - ) { - showNode - .getComponents(UIRenderer) - .forEach((renderComponent: UIRenderer) => { - renderComponent.setSharedMaterial(material, 0) - }) - showNode.children.forEach((childNode) => { - childNode - .getComponents(UIRenderer) - .forEach((renderComponent: UIRenderer) => { - renderComponent.setSharedMaterial(material, 0) - }) - }) - } + /** + * 清除所有shader + * @param showNode + * @param material + */ + public static clearAllEffect( + showNode: Node, + material: Material = ShaderMaterialPrefab.instance.getComponent( + ShaderMaterialPrefab + ).default + ) { + showNode + .getComponents(UIRenderer) + .forEach((renderComponent: UIRenderer) => { + renderComponent.setSharedMaterial(material, 0) + }) + showNode.children.forEach((childNode) => { + childNode + .getComponents(UIRenderer) + .forEach((renderComponent: UIRenderer) => { + renderComponent.setSharedMaterial(material, 0) + }) + }) + } - /** - * 设置图片灰白程度 - * @param showNode - * @param material - * @param grayLevel [0.0, 1.0] - */ - public static setGrayEffect( - showNode: Node, - grayLevel: number = 1, - material: Material = ShaderMaterialPrefab.instance.getComponent( - ShaderMaterialPrefab - ).grayMaterial - ) { - showNode - .getComponents(UIRenderer) - .forEach((renderComponent: UIRenderer) => { - material.setProperty('grayLevel', grayLevel) - renderComponent.setMaterial(material, 0) - }) - showNode.children.forEach((childNode) => { - childNode - .getComponents(UIRenderer) - .forEach((renderComponent: UIRenderer) => { - material.setProperty('grayLevel', grayLevel) - renderComponent.setSharedMaterial(material, 0) - }) - }) - } + /** + * 设置图片灰白程度 + * @param showNode + * @param grayLevel + * @param material + */ + public static setGrayEffect( + showNode: Node, + grayLevel: number = 1, + material: Material = ShaderMaterialPrefab.instance.getComponent( + ShaderMaterialPrefab + ).grayMaterial + ) { + showNode + .getComponents(UIRenderer) + .forEach((renderComponent: UIRenderer) => { + material.setProperty('grayLevel', grayLevel) + renderComponent.setMaterial(material, 0) + }) + showNode.children.forEach((childNode) => { + childNode + .getComponents(UIRenderer) + .forEach((renderComponent: UIRenderer) => { + material.setProperty('grayLevel', grayLevel) + renderComponent.setSharedMaterial(material, 0) + }) + }) + } - /** - * 播放变灰过程动画 - */ - public static showGrayMv(showNode: Node) { - let grayValue: number = 0.5 - let intervalId = setInterval(() => { - grayValue += 0.01 - if (grayValue >= 1) { - grayValue = 1 - clearInterval(intervalId) - } - if (showNode) { - ShaderHelper.setGrayEffect(showNode, grayValue) - } - }, 1) - } + /** + * 播放变灰过程动画 + */ + public static showGrayMv(showNode: Node) { + let grayValue: number = 0.5 + let intervalId = setInterval(() => { + grayValue += 0.01 + if (grayValue >= 1) { + grayValue = 1 + clearInterval(intervalId) + } + if (showNode) { + ShaderHelper.setGrayEffect(showNode, grayValue) + } + }, 1) + } - /** - * 设置图片老化 - * @param showNode - * @param grayLevel [0.0, 1.0] - * @param material - */ - public static setOldPhotoEffect( - showNode: Node, - grayLevel: number = 1, - material: Material = ShaderMaterialPrefab.instance.getComponent( - ShaderMaterialPrefab - ).oldPhoto - ) { - showNode - .getComponents(UIRenderer) - .forEach((renderComponent: UIRenderer) => { - material.setProperty('oldLevel', grayLevel) - renderComponent.setSharedMaterial(material, 0) - }) - showNode.children.forEach((childNode) => { - childNode - .getComponents(UIRenderer) - .forEach((renderComponent: UIRenderer) => { - material.setProperty('oldLevel', grayLevel) - renderComponent.setSharedMaterial(material, 0) - }) - }) - } + /** + * 设置图片老化 + * @param showNode + * @param grayLevel + * @param material + */ + public static setOldPhotoEffect( + showNode: Node, + grayLevel: number = 1, + material: Material = ShaderMaterialPrefab.instance.getComponent( + ShaderMaterialPrefab + ).oldPhoto + ) { + showNode + .getComponents(UIRenderer) + .forEach((renderComponent: UIRenderer) => { + material.setProperty('oldLevel', grayLevel) + renderComponent.setSharedMaterial(material, 0) + }) + showNode.children.forEach((childNode) => { + childNode + .getComponents(UIRenderer) + .forEach((renderComponent: UIRenderer) => { + material.setProperty('oldLevel', grayLevel) + renderComponent.setSharedMaterial(material, 0) + }) + }) + } - /** - * 播放变灰过程动画 - */ - public static showOldPhotoMv(showNode: Node) { - let grayValue: number = 0 - let intervalId = setInterval(() => { - grayValue += 0.01 - if (grayValue >= 1) { - grayValue = 1 - clearInterval(intervalId) - } - if (showNode) { - ShaderHelper.setOldPhotoEffect(showNode, grayValue) - } - }, 1) - } + /** + * 播放变灰过程动画 + */ + public static showOldPhotoMv(showNode: Node) { + let grayValue: number = 0 + let intervalId = setInterval(() => { + grayValue += 0.01 + if (grayValue >= 1) { + grayValue = 1 + clearInterval(intervalId) + } + if (showNode) { + ShaderHelper.setOldPhotoEffect(showNode, grayValue) + } + }, 1) + } - /** - * 增加内发光特效 - * showNode:要增加特效的节点或者他的子节点 - * material:发光特效材质 - * materialParam: {} - * materialParam.glowColor:cc.v4(r,g,b,a) 颜色rbga值的结构体 - * materialParam.glowColorSize:这里为约束一下值发光宽度值在 [0.0, 0.1] 因为 0.1+ 之后的效果可能不明显,也可以自己尝试修改,个人测试感觉0.01效果最佳 - * materialParam.glowThreshold:这里为约束一下值发光阈值值在 [0.0, 0.5] 因为 0.5+ 之后的效果可能就是其他效果,个人感觉0.1效果最佳 - */ - public static setGlowInner( - showNode: Node, - materialParam: any, - material: Material = ShaderMaterialPrefab.instance.getComponent( - ShaderMaterialPrefab - ).glowInner - ) { - showNode - .getComponents(UIRenderer) - .forEach((renderComponent: UIRenderer) => { - material.setProperty('glowColor', materialParam.glowColor) - material.setProperty('glowColorSize', materialParam.glowColorSize) - material.setProperty('glowThreshold', materialParam.glowThreshold) - renderComponent.setSharedMaterial(material, 0) - }) - showNode.children.forEach((childNode) => { - childNode - .getComponents(UIRenderer) - .forEach((renderComponent: UIRenderer) => { - material.setProperty('glowColor', materialParam.glowColor) - material.setProperty('glowColorSize', materialParam.glowColorSize) - material.setProperty('glowThreshold', materialParam.glowThreshold) - renderComponent.setMaterial(material, 0) - }) - }) - } + /** + * 增加内发光特效 + * showNode:要增加特效的节点或者他的子节点 + * material:发光特效材质 + * materialParam: {} + * materialParam.glowColor:cc.v4(r,g,b,a) 颜色rbga值的结构体 + * materialParam.glowColorSize:这里为约束一下值发光宽度值在 [0.0, 0.1] 因为 0.1+ 之后的效果可能不明显,也可以自己尝试修改,个人测试感觉0.01效果最佳 + * materialParam.glowThreshold:这里为约束一下值发光阈值值在 [0.0, 0.5] 因为 0.5+ 之后的效果可能就是其他效果,个人感觉0.1效果最佳 + */ + public static setGlowInner( + showNode: Node, + materialParam: any, + material: Material = ShaderMaterialPrefab.instance.getComponent( + ShaderMaterialPrefab + ).glowInner + ) { + showNode + .getComponents(UIRenderer) + .forEach((renderComponent: UIRenderer) => { + material.setProperty('glowColor', materialParam.glowColor) + material.setProperty('glowColorSize', materialParam.glowColorSize) + material.setProperty('glowThreshold', materialParam.glowThreshold) + renderComponent.setSharedMaterial(material, 0) + }) + showNode.children.forEach((childNode) => { + childNode + .getComponents(UIRenderer) + .forEach((renderComponent: UIRenderer) => { + material.setProperty('glowColor', materialParam.glowColor) + material.setProperty('glowColorSize', materialParam.glowColorSize) + material.setProperty('glowThreshold', materialParam.glowThreshold) + renderComponent.setMaterial(material, 0) + }) + }) + } - /** - * 设置不同颜色的发光 - * @param showNode - * @param color - */ - public static setCommonGlowInner(showNode: Node, color: Color = Color.WHITE) { - this.setGlowInner(showNode, { - glowColor: color, - glowColorSize: 0.015, - glowThreshold: 0.1, - }) - } + /** + * 设置不同颜色的发光 + * @param showNode + * @param color + */ + public static setCommonGlowInner(showNode: Node, color: Color = Color.WHITE) { + this.setGlowInner(showNode, { + glowColor: color, + glowColorSize: 0.015, + glowThreshold: 0.1 + }) + } - /** - * 播放被攻击闪烁过程动画 - */ - public static showFlash(showNode: Node, totalFlashTimes: number = 1) { - let timeCount: number = 0 - let color: Color = Color.WHITE - let flashTimes: number = 0 - let intervalId = setInterval(() => { - timeCount += 1 - if (timeCount % 50 == 0) { - let tempCount: number = timeCount / 50 - if (tempCount % 2 == 0) { - color.a = 100 - this.setGlowInner(showNode, { - glowColor: color, - glowColorSize: 0.1, - glowThreshold: 0, - }) - } else { - flashTimes++ - this.setGlowInner(showNode, { - glowColor: color, - glowColorSize: 0, - glowThreshold: 0, - }) - if (flashTimes > totalFlashTimes) { - clearInterval(intervalId) - } - } - } - }, 1) - } + /** + * 播放被攻击闪烁过程动画 + */ + public static showFlash(showNode: Node, totalFlashTimes: number = 1) { + let timeCount: number = 0 + let color: Color = Color.WHITE + let flashTimes: number = 0 + let intervalId = setInterval(() => { + timeCount += 1 + if (timeCount % 50 == 0) { + let tempCount: number = timeCount / 50 + if (tempCount % 2 == 0) { + color.a = 100 + this.setGlowInner(showNode, { + glowColor: color, + glowColorSize: 0.1, + glowThreshold: 0 + }) + } else { + flashTimes++ + this.setGlowInner(showNode, { + glowColor: color, + glowColorSize: 0, + glowThreshold: 0 + }) + if (flashTimes > totalFlashTimes) { + clearInterval(intervalId) + } + } + } + }, 1) + } - /** - * 马赛克 - * @param showNode - * @param materialParam - * @param material - */ - public static setMosaic( - showNode: Node, - materialParam: any, - material: Material = ShaderMaterialPrefab.instance.getComponent( - ShaderMaterialPrefab - ).mosaic - ) { - showNode - .getComponents(UIRenderer) - .forEach((renderComponent: UIRenderer) => { - material.setProperty('xBlockCount', materialParam.xBlockCount) - material.setProperty('yBlockCount', materialParam.yBlockCount) - renderComponent.setSharedMaterial(material, 0) - }) - showNode.children.forEach((childNode) => { - childNode - .getComponents(UIRenderer) - .forEach((renderComponent: UIRenderer) => { - material.setProperty('xBlockCount', materialParam.xBlockCount) - material.setProperty('yBlockCount', materialParam.yBlockCount) - renderComponent.setSharedMaterial(material, 0) - }) - }) - } + /** + * 马赛克 + * @param showNode + * @param materialParam + * @param material + */ + public static setMosaic( + showNode: Node, + materialParam: any, + material: Material = ShaderMaterialPrefab.instance.getComponent( + ShaderMaterialPrefab + ).mosaic + ) { + showNode + .getComponents(UIRenderer) + .forEach((renderComponent: UIRenderer) => { + material.setProperty('xBlockCount', materialParam.xBlockCount) + material.setProperty('yBlockCount', materialParam.yBlockCount) + renderComponent.setSharedMaterial(material, 0) + }) + showNode.children.forEach((childNode) => { + childNode + .getComponents(UIRenderer) + .forEach((renderComponent: UIRenderer) => { + material.setProperty('xBlockCount', materialParam.xBlockCount) + material.setProperty('yBlockCount', materialParam.yBlockCount) + renderComponent.setSharedMaterial(material, 0) + }) + }) + } - /** - * 播放被攻击闪烁过程动画 - */ - public static showMosaicMv(showNode: Node, callback: Function = null) { - let masaicTimes: number = 500 - let intervalId = setInterval(() => { - masaicTimes -= 2 - this.setMosaic(showNode, { - xBlockCount: masaicTimes, - yBlockCount: masaicTimes, - }) - if (masaicTimes <= 30) { - clearInterval(intervalId) - if (callback) { - callback() - } - } - }, 1) - } + /** + * 播放被攻击闪烁过程动画 + */ + public static showMosaicMv(showNode: Node, callback: Function = null) { + let masaicTimes: number = 500 + let intervalId = setInterval(() => { + masaicTimes -= 2 + this.setMosaic(showNode, { + xBlockCount: masaicTimes, + yBlockCount: masaicTimes + }) + if (masaicTimes <= 30) { + clearInterval(intervalId) + if (callback) { + callback() + } + } + }, 1) + } - /** - * 设置圆角剪切 - * @param showNode - * @param roundCornerRadius [0, 1] - */ - public static setRoundCornerCrop( - showNode: Node, - roundCornerRadius: number = 0.1, - material: Material = ShaderMaterialPrefab.instance.getComponent( - ShaderMaterialPrefab - ).roundCornerCrop - ) { - showNode - .getComponents(UIRenderer) - .forEach((renderComponent: UIRenderer) => { - // material.setProperty("roundCornerRadius", roundCornerRadius); - material.setProperty('xRadius', roundCornerRadius) - material.setProperty('yRadius', roundCornerRadius) - renderComponent.setSharedMaterial(material, 0) - }) - showNode.children.forEach((childNode) => { - childNode - .getComponents(UIRenderer) - .forEach((renderComponent: UIRenderer) => { - // material.setProperty("roundCornerRadius", roundCornerRadius); - material.setProperty('xRadius', roundCornerRadius) - material.setProperty('yRadius', roundCornerRadius) - renderComponent.setSharedMaterial(material, 0) - }) - }) - } + /** + * 设置圆角剪切 + * @param showNode + * @param roundCornerRadius + * @param material + */ + public static setRoundCornerCrop( + showNode: Node, + roundCornerRadius: number = 0.1, + material: Material = ShaderMaterialPrefab.instance.getComponent( + ShaderMaterialPrefab + ).roundCornerCrop + ) { + showNode + .getComponents(UIRenderer) + .forEach((renderComponent: UIRenderer) => { + // material.setProperty("roundCornerRadius", roundCornerRadius); + material.setProperty('xRadius', roundCornerRadius) + material.setProperty('yRadius', roundCornerRadius) + renderComponent.setSharedMaterial(material, 0) + }) + showNode.children.forEach((childNode) => { + childNode + .getComponents(UIRenderer) + .forEach((renderComponent: UIRenderer) => { + // material.setProperty("roundCornerRadius", roundCornerRadius); + material.setProperty('xRadius', roundCornerRadius) + material.setProperty('yRadius', roundCornerRadius) + renderComponent.setSharedMaterial(material, 0) + }) + }) + } - /** - * 设置闪光 - * @param showNode - * @param lightColor 光颜色 - * @param lightWidth 光的宽度 - * @param lightAngle 光的角度 - * @param enableGradient - * @param cropAlpha - * @param enableFog - * @param material - */ - public static setFlashLight( - showNode: Node, - lightColor: Color, - lightWidth: number, - lightAngle: number = 0, - enableGradient: boolean = true, - cropAlpha: boolean = true, - enableFog: boolean = false, - material: Material = ShaderMaterialPrefab.instance.getComponent( - ShaderMaterialPrefab - ).flashLight - ) { - showNode - .getComponents(UIRenderer) - .forEach((renderComponent: UIRenderer) => { - material.setProperty('lightColor', lightColor) - material.setProperty('lightWidth', lightWidth) - material.setProperty('lightAngle', lightAngle) - material.setProperty('enableGradient', enableGradient ? 1 : 0) - material.setProperty('cropAlpha', cropAlpha ? 1 : 0) - material.setProperty('enableFog', enableFog ? 1 : 0) - renderComponent.setSharedMaterial(material, 0) - }) - showNode.children.forEach((childNode) => { - childNode - .getComponents(UIRenderer) - .forEach((renderComponent: UIRenderer) => { - material.setProperty('lightColor', lightColor) - material.setProperty('lightWidth', lightWidth) - material.setProperty('lightAngle', lightAngle) - material.setProperty('enableGradient', enableGradient ? 1 : 0) - material.setProperty('cropAlpha', cropAlpha ? 1 : 0) - material.setProperty('enableFog', enableFog ? 1 : 0) - renderComponent.setSharedMaterial(material, 0) - }) - }) - } + /** + * 设置闪光 + * @param showNode + * @param lightColor 光颜色 + * @param lightWidth 光的宽度 + * @param lightAngle 光的角度 + * @param enableGradient + * @param cropAlpha + * @param enableFog + * @param material + */ + public static setFlashLight( + showNode: Node, + lightColor: Color, + lightWidth: number, + lightAngle: number = 0, + enableGradient: boolean = true, + cropAlpha: boolean = true, + enableFog: boolean = false, + material: Material = ShaderMaterialPrefab.instance.getComponent( + ShaderMaterialPrefab + ).flashLight + ) { + showNode + .getComponents(UIRenderer) + .forEach((renderComponent: UIRenderer) => { + material.setProperty('lightColor', lightColor) + material.setProperty('lightWidth', lightWidth) + material.setProperty('lightAngle', lightAngle) + material.setProperty('enableGradient', enableGradient ? 1 : 0) + material.setProperty('cropAlpha', cropAlpha ? 1 : 0) + material.setProperty('enableFog', enableFog ? 1 : 0) + renderComponent.setSharedMaterial(material, 0) + }) + showNode.children.forEach((childNode) => { + childNode + .getComponents(UIRenderer) + .forEach((renderComponent: UIRenderer) => { + material.setProperty('lightColor', lightColor) + material.setProperty('lightWidth', lightWidth) + material.setProperty('lightAngle', lightAngle) + material.setProperty('enableGradient', enableGradient ? 1 : 0) + material.setProperty('cropAlpha', cropAlpha ? 1 : 0) + material.setProperty('enableFog', enableFog ? 1 : 0) + renderComponent.setSharedMaterial(material, 0) + }) + }) + } - /** - * 玩家升级shader动画 - * @param showNode - * @param callback - */ - public static showFlashLightMv(showNode: Node, callback: Function = null) { - let nowClor: Color = new Color(0, 0, 0, 255) - let colorIndex: number = 0 - let lightAngle: number = 0 - let intervalId = setInterval(() => { - if (colorIndex == 0) { - nowClor.r = nowClor.r + 2 - if (nowClor.r >= 255) { - colorIndex += 1 - } - } else if (colorIndex == 1) { - nowClor.g = nowClor.g + 2 - if (nowClor.g >= 255) { - colorIndex += 1 - } - } else { - nowClor.b = nowClor.b + 2 - if (nowClor.b >= 255) { - clearInterval(intervalId) - ShaderHelper.clearAllEffect(showNode) - if (callback) { - callback() - } - return - } - } - lightAngle += 1 - this.setFlashLight(showNode, nowClor, 1, lightAngle) - }, 1) - } + /** + * 玩家升级shader动画 + * @param showNode + * @param callback + */ + public static showFlashLightMv(showNode: Node, callback: Function = null) { + let nowClor: Color = new Color(0, 0, 0, 255) + let colorIndex: number = 0 + let lightAngle: number = 0 + let intervalId = setInterval(() => { + if (colorIndex == 0) { + nowClor.r = nowClor.r + 2 + if (nowClor.r >= 255) { + colorIndex += 1 + } + } else if (colorIndex == 1) { + nowClor.g = nowClor.g + 2 + if (nowClor.g >= 255) { + colorIndex += 1 + } + } else { + nowClor.b = nowClor.b + 2 + if (nowClor.b >= 255) { + clearInterval(intervalId) + ShaderHelper.clearAllEffect(showNode) + if (callback) { + callback() + } + return + } + } + lightAngle += 1 + this.setFlashLight(showNode, nowClor, 1, lightAngle) + }, 1) + } - public static setFlag( - showNode: Node, - material: Material = ShaderMaterialPrefab.instance.getComponent( - ShaderMaterialPrefab - ).flag - ) { - showNode - .getComponents(UIRenderer) - .forEach((renderComponent: UIRenderer) => { - renderComponent.setSharedMaterial(material, 0) - }) - showNode.children.forEach((childNode) => { - childNode - .getComponents(UIRenderer) - .forEach((renderComponent: UIRenderer) => { - renderComponent.setSharedMaterial(material, 0) - }) - }) - } + public static setFlag( + showNode: Node, + material: Material = ShaderMaterialPrefab.instance.getComponent( + ShaderMaterialPrefab + ).flag + ) { + showNode + .getComponents(UIRenderer) + .forEach((renderComponent: UIRenderer) => { + renderComponent.setSharedMaterial(material, 0) + }) + showNode.children.forEach((childNode) => { + childNode + .getComponents(UIRenderer) + .forEach((renderComponent: UIRenderer) => { + renderComponent.setSharedMaterial(material, 0) + }) + }) + } - /** - * 设置高斯模糊 - * @param showNode - * @param material - */ - public static setGaussian( - showNode: Node, - material: Material = ShaderMaterialPrefab.instance.getComponent( - ShaderMaterialPrefab - ).gaussian - ) { - showNode - .getComponents(UIRenderer) - .forEach((renderComponent: UIRenderer) => { - let tran = renderComponent.node.getComponent(UITransform) - material.setProperty( - 'textureSize', - new Vec2(tran.contentSize.width, tran.contentSize.height) - ) - renderComponent.setMaterial(material, 0) - }) - showNode.children.forEach((childNode) => { - childNode - .getComponents(UIRenderer) - .forEach((renderComponent: UIRenderer) => { - let tran = renderComponent.node.getComponent(UITransform) - material.setProperty( - 'textureSize', - new Vec2(tran.contentSize.width, tran.contentSize.height) - ) - // material.setProperty("textureSize", cc.v2(showNode.width, showNode.height)); - renderComponent.setSharedMaterial(material, 0) - }) - }) - } + /** + * 设置高斯模糊 + * @param showNode + * @param material + */ + public static setGaussian( + showNode: Node, + material: Material = ShaderMaterialPrefab.instance.getComponent( + ShaderMaterialPrefab + ).gaussian + ) { + showNode + .getComponents(UIRenderer) + .forEach((renderComponent: UIRenderer) => { + let tran = renderComponent.node.getComponent(UITransform) + material.setProperty( + 'textureSize', + new Vec2(tran.contentSize.width, tran.contentSize.height) + ) + renderComponent.setMaterial(material, 0) + }) + showNode.children.forEach((childNode) => { + childNode + .getComponents(UIRenderer) + .forEach((renderComponent: UIRenderer) => { + let tran = renderComponent.node.getComponent(UITransform) + material.setProperty( + 'textureSize', + new Vec2(tran.contentSize.width, tran.contentSize.height) + ) + // material.setProperty("textureSize", cc.v2(showNode.width, showNode.height)); + renderComponent.setSharedMaterial(material, 0) + }) + }) + } } diff --git a/assets/FishSingle/script/engine/utils/VersionManager.ts b/assets/FishSingle/script/engine/utils/VersionManager.ts index 4a726a2..145b21a 100644 --- a/assets/FishSingle/script/engine/utils/VersionManager.ts +++ b/assets/FishSingle/script/engine/utils/VersionManager.ts @@ -1,139 +1,140 @@ -import { sys, _decorator } from 'cc' +import { sys } from 'cc' import ManifestConfig from '../config/ManifestConfig' import EventManager from './EventManager' import HotUpdate from './HotUpdate' export default class VersionManager { - public static instance: VersionManager = new VersionManager() + public static instance: VersionManager = new VersionManager() - public static Config_Game_Name: Array = ['游戏大厅'] + public static Config_Game_Name: Array = ['游戏大厅'] - //热更文件下载来后存放文件夹 - public static Config_Key: Array = ['main-remote-asset'] + //热更文件下载来后存放文件夹 + public static Config_Key: Array = ['main-remote-asset'] - private static Config_ManifestName: string = 'project.manifest' + private static Config_ManifestName: string = 'project.manifest' - public static Config_Url_Key: Array = ['main'] + public static Config_Url_Key: Array = ['main'] - public iosStoreUrl: string = '' - public apkStoreUrl: string = '' + public iosStoreUrl: string = '' + public apkStoreUrl: string = '' - public nowVersion: string = ManifestConfig.version //网页显示版本号,如果是热更会替换改值 - public targetVersion: string = '1.0.0' + public nowVersion: string = ManifestConfig.version //网页显示版本号,如果是热更会替换改值 + public targetVersion: string = '1.0.0' - public isOpenHotUpdate: boolean = true //是否打开热更 + public isOpenHotUpdate: boolean = true //是否打开热更 - private hotUpdateList: Array = [] + private hotUpdateList: Array = [] - private noUpdateIndex: number = -1 // + private noUpdateIndex: number = -1 // - public init() { - this.reInitAll() - } - public reInitAll() { - this.releaseAll() - for (let i = 0; i < VersionManager.Config_Key.length; i++) { - this.reInit(i) - } - } + public init() { + this.reInitAll() + } - public releaseAll() { - for (let i = 0; i < VersionManager.Config_Key.length; i++) { - if (this.hotUpdateList[i]) { - this.hotUpdateList[i].disposeUpdate() - } - } - } + public reInitAll() { + this.releaseAll() + for (let i = 0; i < VersionManager.Config_Key.length; i++) { + this.reInit(i) + } + } - public reInit(index: number) { - if (!this.hotUpdateList[index]) { - this.hotUpdateList[index] = new HotUpdate() - } - this.hotUpdateList[index].init( - index, - VersionManager.Config_Key[index], - VersionManager.Config_ManifestName - ) - if (!this.isOpenHotUpdate) { - this.hotUpdateList[index].isCheck = true - this.hotUpdateList[index].isFinishUpdate = true - } - } + public releaseAll() { + for (let i = 0; i < VersionManager.Config_Key.length; i++) { + if (this.hotUpdateList[i]) { + this.hotUpdateList[i].disposeUpdate() + } + } + } - public checkUpdate(keyIndex: number) { - if (keyIndex < this.hotUpdateList.length) { - let hotUpdate: HotUpdate = this.hotUpdateList[keyIndex] - if (sys.isNative) { - if (keyIndex == this.noUpdateIndex) { - //在大厅热更,不用子游戏热更了 - hotUpdate.isCheck = true - hotUpdate.isFinishUpdate = true - EventManager.instance.dispatchEvent( - HotUpdate.Event_On_ALREADY_UP_TO_DATE, - VersionManager.Config_Key[keyIndex] - ) - } else { - hotUpdate.checkUpdate() - } - } else { - hotUpdate.isCheck = true - hotUpdate.isFinishUpdate = true - EventManager.instance.dispatchEvent( - HotUpdate.Event_On_ALREADY_UP_TO_DATE, - VersionManager.Config_Key[keyIndex] - ) - } - } else { - EventManager.instance.dispatchEvent( - HotUpdate.Event_On_ALREADY_UP_TO_DATE, - VersionManager.Config_Key[keyIndex] - ) - } - } + public reInit(index: number) { + if (!this.hotUpdateList[index]) { + this.hotUpdateList[index] = new HotUpdate() + } + this.hotUpdateList[index].init( + index, + VersionManager.Config_Key[index], + VersionManager.Config_ManifestName + ) + if (!this.isOpenHotUpdate) { + this.hotUpdateList[index].isCheck = true + this.hotUpdateList[index].isFinishUpdate = true + } + } - public startUpdate(keyIndex: number) { - let hotUpdate: HotUpdate = this.hotUpdateList[keyIndex] - hotUpdate.startUpdate() - } + public checkUpdate(keyIndex: number) { + if (keyIndex < this.hotUpdateList.length) { + let hotUpdate: HotUpdate = this.hotUpdateList[keyIndex] + if (sys.isNative) { + if (keyIndex == this.noUpdateIndex) { + //在大厅热更,不用子游戏热更了 + hotUpdate.isCheck = true + hotUpdate.isFinishUpdate = true + EventManager.instance.dispatchEvent( + HotUpdate.Event_On_ALREADY_UP_TO_DATE, + VersionManager.Config_Key[keyIndex] + ) + } else { + hotUpdate.checkUpdate() + } + } else { + hotUpdate.isCheck = true + hotUpdate.isFinishUpdate = true + EventManager.instance.dispatchEvent( + HotUpdate.Event_On_ALREADY_UP_TO_DATE, + VersionManager.Config_Key[keyIndex] + ) + } + } else { + EventManager.instance.dispatchEvent( + HotUpdate.Event_On_ALREADY_UP_TO_DATE, + VersionManager.Config_Key[keyIndex] + ) + } + } - public isCheck(keyIndex: number) { - if (keyIndex < this.hotUpdateList.length) { - let hotUpdate: HotUpdate = this.hotUpdateList[keyIndex] - if (keyIndex == this.noUpdateIndex) { - return true - } - return hotUpdate.isCheck - } - return true - } + public startUpdate(keyIndex: number) { + let hotUpdate: HotUpdate = this.hotUpdateList[keyIndex] + hotUpdate.startUpdate() + } - public needUpdate(keyIndex: number) { - if (keyIndex < this.hotUpdateList.length) { - let hotUpdate: HotUpdate = this.hotUpdateList[keyIndex] - if (keyIndex == this.noUpdateIndex) { - return false - } - return hotUpdate.needUpdate - } - return false - } + public isCheck(keyIndex: number) { + if (keyIndex < this.hotUpdateList.length) { + let hotUpdate: HotUpdate = this.hotUpdateList[keyIndex] + if (keyIndex == this.noUpdateIndex) { + return true + } + return hotUpdate.isCheck + } + return true + } - public isUpdating(keyIndex: number) { - if (keyIndex < this.hotUpdateList.length) { - let hotUpdate: HotUpdate = this.hotUpdateList[keyIndex] - return hotUpdate.isUpdating - } - return false - } + public needUpdate(keyIndex: number) { + if (keyIndex < this.hotUpdateList.length) { + let hotUpdate: HotUpdate = this.hotUpdateList[keyIndex] + if (keyIndex == this.noUpdateIndex) { + return false + } + return hotUpdate.needUpdate + } + return false + } - public isFinishUpdate(keyIndex: number) { - if (keyIndex < this.hotUpdateList.length) { - let hotUpdate: HotUpdate = this.hotUpdateList[keyIndex] - if (keyIndex == this.noUpdateIndex) { - return true - } - return hotUpdate.isFinishUpdate - } - return true - } + public isUpdating(keyIndex: number) { + if (keyIndex < this.hotUpdateList.length) { + let hotUpdate: HotUpdate = this.hotUpdateList[keyIndex] + return hotUpdate.isUpdating + } + return false + } + + public isFinishUpdate(keyIndex: number) { + if (keyIndex < this.hotUpdateList.length) { + let hotUpdate: HotUpdate = this.hotUpdateList[keyIndex] + if (keyIndex == this.noUpdateIndex) { + return true + } + return hotUpdate.isFinishUpdate + } + return true + } } diff --git a/assets/FishSingle/script/game/config/FishConfig.ts b/assets/FishSingle/script/game/config/FishConfig.ts index d3a8d75..639058a 100644 --- a/assets/FishSingle/script/game/config/FishConfig.ts +++ b/assets/FishSingle/script/game/config/FishConfig.ts @@ -1,44 +1,44 @@ -import { _decorator } from 'cc' import { FishInfo } from './FishInfo' export class FishConfig { - public static readonly config: ReadonlyArray = [ - new FishInfo(1, '蝴蝶鱼', 2, 2), - new FishInfo(2, '鲶鱼', 2, 1), - new FishInfo(3, '狮子鱼', 2, 2), - new FishInfo(4, '条纹鱼', 2, 2), - new FishInfo(5, '沙丁鱼', 2, 2), - new FishInfo(6, '石斑鱼', 2, 2), - new FishInfo(7, '河豚', 3, 1.2), - new FishInfo(8, '海螺', 3, 2), - new FishInfo(9, '接吻鱼', 3, 1.2), - new FishInfo(10, '海姆', 4, 1), - new FishInfo(11, '绿鳍鱼', 4, 1.2), - new FishInfo(12, '鲎', 4, 1.2), - new FishInfo(13, '魔鬼鱼', 5, 0.6), - new FishInfo(14, '小海龟', 5, 2), - new FishInfo(15, '锤头鲨', 6, 0.5), - new FishInfo(16, '金枪鱼', 6, 0.5), - new FishInfo(17, '大三元', 6, 0.5), - new FishInfo(18, '黄金鲎', 6, 1.2), - new FishInfo(19, '大四喜', 7, 0.5), - new FishInfo(20, '黄金锤头鲨', 7, 0.5), - new FishInfo(21, '金海姆', 7, 0.6), - new FishInfo(22, '五福临门', 8, 0.4), - new FishInfo(23, '金海龟', 8, 0.7), - new FishInfo(24, '金鲨', 8, 0.5), - new FishInfo(25, '蓝鲨', 8, 0.5), - new FishInfo(26, '美人鱼', 14, 0.4), - new FishInfo(27, '金龙', 14, 0.3), - new FishInfo(28, '章鱼', 10, 0.5), - new FishInfo(29, '电鳗鱼', 3, 0.8), - ] - public static getFishInfoByType(fishType: number) { - for (let i = 0; i < this.config.length; i++) { - let fishInfo: FishInfo = this.config[i] - if (fishInfo.fishType == fishType) { - return fishInfo - } - } - } + public static readonly config: ReadonlyArray = [ + new FishInfo(1, '蝴蝶鱼', 2, 2), + new FishInfo(2, '鲶鱼', 2, 1), + new FishInfo(3, '狮子鱼', 2, 2), + new FishInfo(4, '条纹鱼', 2, 2), + new FishInfo(5, '沙丁鱼', 2, 2), + new FishInfo(6, '石斑鱼', 2, 2), + new FishInfo(7, '河豚', 3, 1.2), + new FishInfo(8, '海螺', 3, 2), + new FishInfo(9, '接吻鱼', 3, 1.2), + new FishInfo(10, '海姆', 4, 1), + new FishInfo(11, '绿鳍鱼', 4, 1.2), + new FishInfo(12, '鲎', 4, 1.2), + new FishInfo(13, '魔鬼鱼', 5, 0.6), + new FishInfo(14, '小海龟', 5, 2), + new FishInfo(15, '锤头鲨', 6, 0.5), + new FishInfo(16, '金枪鱼', 6, 0.5), + new FishInfo(17, '大三元', 6, 0.5), + new FishInfo(18, '黄金鲎', 6, 1.2), + new FishInfo(19, '大四喜', 7, 0.5), + new FishInfo(20, '黄金锤头鲨', 7, 0.5), + new FishInfo(21, '金海姆', 7, 0.6), + new FishInfo(22, '五福临门', 8, 0.4), + new FishInfo(23, '金海龟', 8, 0.7), + new FishInfo(24, '金鲨', 8, 0.5), + new FishInfo(25, '蓝鲨', 8, 0.5), + new FishInfo(26, '美人鱼', 14, 0.4), + new FishInfo(27, '金龙', 14, 0.3), + new FishInfo(28, '章鱼', 10, 0.5), + new FishInfo(29, '电鳗鱼', 3, 0.8) + ] + + public static getFishInfoByType(fishType: number) { + for (let i = 0; i < this.config.length; i++) { + let fishInfo: FishInfo = this.config[i] + if (fishInfo.fishType == fishType) { + return fishInfo + } + } + } } diff --git a/assets/FishSingle/script/game/config/FishInfo.ts b/assets/FishSingle/script/game/config/FishInfo.ts index badd85d..d6ac67a 100644 --- a/assets/FishSingle/script/game/config/FishInfo.ts +++ b/assets/FishSingle/script/game/config/FishInfo.ts @@ -1,18 +1,18 @@ -import { _decorator } from 'cc' export class FishInfo { - public fishType: number - public name: string - public blood: number - public wikiScale: number - constructor( - fishType: number, - name: string, - blood: number, - wikiScale: number - ) { - this.fishType = fishType - this.name = name - this.blood = blood - this.wikiScale = wikiScale - } + public fishType: number + public name: string + public blood: number + public wikiScale: number + + constructor( + fishType: number, + name: string, + blood: number, + wikiScale: number + ) { + this.fishType = fishType + this.name = name + this.blood = blood + this.wikiScale = wikiScale + } } diff --git a/assets/FishSingle/script/game/config/FishMap.ts b/assets/FishSingle/script/game/config/FishMap.ts index 3e412a3..a1faafd 100644 --- a/assets/FishSingle/script/game/config/FishMap.ts +++ b/assets/FishSingle/script/game/config/FishMap.ts @@ -1,11 +1,11 @@ -import { _decorator } from 'cc' import { FishMapInfo } from './FishMapInfo' export class FishMap { - public mapId: number - public fishMapInfoList: Array - constructor(mapId: number, list: Array) { - this.mapId = mapId - this.fishMapInfoList = list - } + public mapId: number + public fishMapInfoList: Array + + constructor(mapId: number, list: Array) { + this.mapId = mapId + this.fishMapInfoList = list + } } diff --git a/assets/FishSingle/script/game/config/FishMapInfo.ts b/assets/FishSingle/script/game/config/FishMapInfo.ts index dbcd0e1..ff020f4 100644 --- a/assets/FishSingle/script/game/config/FishMapInfo.ts +++ b/assets/FishSingle/script/game/config/FishMapInfo.ts @@ -1,21 +1,21 @@ -import { _decorator } from 'cc' export class FishMapInfo { - public fishType: number - public scale: number - public side: number //1: -1: - public x: number - public y: number - constructor( - fishType: number, - scale: number, - side: number, - x: number, - y: number - ) { - this.fishType = fishType - this.scale = scale - this.side = side - this.x = x - this.y = y - } + public fishType: number + public scale: number + public side: number //1: -1: + public x: number + public y: number + + constructor( + fishType: number, + scale: number, + side: number, + x: number, + y: number + ) { + this.fishType = fishType + this.scale = scale + this.side = side + this.x = x + this.y = y + } } diff --git a/assets/FishSingle/script/game/config/FishPathConfig.ts b/assets/FishSingle/script/game/config/FishPathConfig.ts index f687714..6380375 100644 --- a/assets/FishSingle/script/game/config/FishPathConfig.ts +++ b/assets/FishSingle/script/game/config/FishPathConfig.ts @@ -1,998 +1,997 @@ -import { Vec2, _decorator } from 'cc' +import { Vec2 } from 'cc' import { FishPathInfo } from './FishPathInfo' import RandomUtil from '../../engine/utils/RandomUtil' import { FishMapInfo } from './FishMapInfo' import { FishMap } from './FishMap' -import { Logger } from '../../engine/utils/Logger' export class FishPathConfig { - private static mapConfig: Array>> = [ - [ - [1, 1, 1, -425, 387], - [1, 1, 1, -487, 352], - [1, 1, 1, -541, 307], - [1, 1, 1, -589, 263], - [1, 1, 1, -623, 232], - [1, 1, 1, -654, 172], - [1, 1, 1, -671, 134], - [1, 1, 1, -693, 92], - [1, 1, 1, -697, 35], - [1, 1, 1, -706, -19], - [1, 1, 1, -707, -92], - [1, 1, 1, -701, -136], - [1, 1, 1, -702, -177], - [1, 1, 1, -686, -230], - [1, 1, 1, -637, -257], - [1, 1, 1, -559, -272], - [1, 1, 1, -471, -278], - [1, 1, 1, -408, -259], - [1, 1, 1, -337, -226], - [1, 1, 1, -325, -170], - [1, 1, 1, -322, -99], - [1, 1, 1, -336, -39], - [1, 1, 1, -370, 7], - [1, 1, 1, -412, 59], - [1, 1, 1, -532, 69], - [1, 1, 1, -613, 82], - [1, 1, 1, -470, 63], - [1, 1, 1, 241, 402], - [1, 1, 1, 184, 357], - [1, 1, 1, 143, 335], - [1, 1, 1, 81, 285], - [1, 1, 1, 27, 229], - [1, 1, 1, -9, 167], - [1, 1, 1, -39, 126], - [1, 1, 1, -47, 57], - [1, 1, 1, -74, -10], - [1, 1, 1, -62, -66], - [1, 1, 1, -74, -118], - [1, 1, 1, -85, -201], - [1, 1, 1, -30, -240], - [1, 1, 1, 10, -271], - [1, 1, 1, 135, -273], - [1, 1, 1, 79, -280], - [1, 1, 1, 202, -280], - [1, 1, 1, 266, -276], - [1, 1, 1, 276, -274], - [1, 1, 1, 307, -259], - [1, 1, 1, 316, -244], - [1, 1, 1, 327, -226], - [1, 1, 1, 335, -195], - [1, 1, 1, 337, -142], - [1, 1, 1, 321, -53], - [1, 1, 1, 271, -13], - [1, 1, 1, 188, 27], - [1, 1, 1, 123, 46], - [1, 1, 1, 59, 57], - [1, 1, 1, 17, 60], - [1, 1, 1, 323, -101], - [1, 1, 1, 732, 329], - [1, 1, 1, 669, 283], - [1, 1, 1, 613, 218], - [1, 1, 1, 567, 185], - [1, 1, 1, 558, 163], - [1, 1, 1, 507, 95], - [1, 1, 1, 468, 35], - [1, 1, 1, 456, -18], - [1, 1, 1, 451, -80], - [1, 1, 1, 447, -164], - [1, 1, 1, 458, -234], - [1, 1, 1, 505, -267], - [1, 1, 1, 578, -281], - [1, 1, 1, 657, -291], - [1, 1, 1, 708, -291], - [1, 1, 1, 769, -291], - [1, 1, 1, 812, -290], - [1, 1, 1, 847, -275], - [1, 1, 1, 860, -236], - [1, 1, 1, 853, -160], - [1, 1, 1, 826, -95], - [1, 1, 1, 794, -46], - [1, 1, 1, 754, -7], - [1, 1, 1, 671, 26], - [1, 1, 1, 630, 59], - [1, 1, 1, 584, 80], - ], - [ - [2, 1, 1, -784, 353], - [2, 1, 1, -693, 356], - [2, 1, 1, -614, 354], - [2, 1, 1, -510, 354], - [2, 1, 1, -422, 354], - [2, 1, 1, -456, 287], - [2, 1, 1, -510, 199], - [2, 1, 1, -562, 139], - [2, 1, 1, -600, 82], - [2, 1, 1, -636, 38], - [2, 1, 1, -688, -17], - [2, 1, 1, -745, -92], - [2, 1, 1, -764, -152], - [2, 1, 1, -815, -216], - [2, 1, 1, -166, 341], - [2, 1, 1, -17, 343], - [2, 1, 1, 89, 343], - [2, 1, 1, 246, 331], - [2, 1, 1, 326, 348], - [2, 1, 1, -180, 310], - [2, 1, 1, -144, 209], - [2, 1, 1, -112, 151], - [2, 1, 1, -74, 55], - [2, 1, 1, -48, 0], - [2, 1, 1, 4, -91], - [2, 1, 1, 40, -153], - [2, 1, 1, 85, -201], - [2, 1, 1, 102, -247], - [3, 1, 1, 595, 319], - [3, 1, 1, 664, 322], - [3, 1, 1, 799, 318], - [3, 1, 1, 968, 319], - [3, 1, 1, 963, 107], - [3, 1, 1, 955, -21], - [3, 1, 1, 948, -157], - [3, 1, 1, 940, -231], - [3, 1, 1, 795, -245], - [3, 1, 1, 685, -248], - [3, 1, 1, 610, -252], - [3, 1, 1, 523, -253], - [3, 1, 1, 172, 128], - [3, 1, 1, -357, 30], - [3, 1, 1, 582, 23], - ], - [ - [5, 1, 1, -888, 405], - [5, 1, 1, -806, 410], - [5, 1, 1, -718, 404], - [5, 1, 1, -658, 406], - [5, 1, 1, -661, 286], - [5, 1, 1, -661, 224], - [5, 1, 1, -664, 142], - [5, 1, 1, -688, -2], - [5, 1, 1, -687, -69], - [5, 1, 1, -697, -120], - [5, 1, 1, -981, 410], - [5, 1, 1, -503, 150], - [5, 1, 1, -432, 146], - [5, 1, 1, -362, 149], - [5, 1, 1, -259, 148], - [5, 1, 1, -192, 149], - [5, 1, 1, -341, 359], - [5, 1, 1, -353, 256], - [5, 1, 1, -354, 203], - [5, 1, 1, -361, 72], - [5, 1, 1, -371, -23], - [5, 1, 1, -387, -79], - [5, 1, 1, 18, 277], - [5, 1, 1, 7, 159], - [5, 1, 1, -7, 94], - [5, 1, 1, -19, -3], - [5, 1, 1, -27, -80], - [5, 1, 1, 177, 164], - [5, 1, 1, 248, 172], - [5, 1, 1, 355, 170], - [5, 1, 1, 153, 29], - [5, 1, 1, 230, 30], - [5, 1, 1, 327, 32], - [6, 1, 1, 548, 371], - [6, 1, 1, 682, 374], - [6, 1, 1, 833, 373], - [6, 1, 1, 942, 374], - [6, 1, 1, 935, 289], - [6, 1, 1, 924, 143], - [6, 1, 1, 903, 65], - [6, 1, 1, 887, -44], - [6, 1, 1, 857, -157], - [6, 1, 1, 526, 109], - [6, 1, 1, 612, 108], - [6, 1, 1, 761, 94], - [6, 1, 1, 710, 260], - [6, 1, 1, 673, 177], - [6, 1, 1, 661, 10], - [6, 1, 1, 634, -61], - [6, 1, 1, 617, -138], - [7, 1, 1, 340, -259], - [7, 1, 1, 485, -254], - [7, 1, 1, 622, -254], - [7, 1, 1, 816, -251], - ], - [ - [9, 1, 1, -513, 150], - [9, 1, 1, -636, 237], - [9, 1, 1, -811, 250], - [9, 1, 1, -860, 145], - [9, 1, 1, -850, -54], - [9, 1, 1, -801, -154], - [9, 1, 1, -673, -268], - [9, 1, 1, -498, -294], - [9, 1, 1, -358, -223], - [9, 1, 1, -207, -127], - [9, 1, 1, -72, 15], - [9, 1, 1, -88, 196], - [9, 1, 1, -240, 285], - [9, 1, 1, -334, 185], - [9, 1, 1, 466, 151], - [9, 1, 1, 310, 202], - [9, 1, 1, 213, 246], - [9, 1, 1, 106, 83], - [9, 1, 1, 141, -54], - [9, 1, 1, 241, -252], - [9, 1, 1, 388, -285], - [9, 1, 1, 605, -295], - [9, 1, 1, 771, -226], - [9, 1, 1, 846, -125], - [9, 1, 1, 893, 51], - [9, 1, 1, 865, 195], - [9, 1, 1, 665, 207], - [17, 1, 1, -461, 2], - [17, 1, 1, 515, -49], - ], - [ - [19, 1, 1, -785, 31], - [19, 1, 1, 905, 16], - [20, 1, 1, -242, 34], - [20, 1, 1, 228, 12], - [20, 1, 1, -30, 303], - [20, 1, 1, -109, -292], - [20, 1, 1, 425, -301], - [20, 1, 1, 537, 265], - [20, 1, 1, -604, 317], - [20, 1, 1, -634, -285], - ], - [ - [21, 1, 1, -757, 94], - [21, 1, 1, 646, 55], - [21, 1, 1, -41, 376], - [21, 1, 1, -102, -315], - [21, 1, 1, -76, 83], - [21, 1, 1, -437, 300], - [21, 1, 1, -434, -155], - [21, 1, 1, 314, -154], - [21, 1, 1, 435, 249], - ], - [ - [22, 1, 1, -548, 65], - [22, 1, 1, 747, 61], - [22, 1, 1, 95, 63], - ], - [ - [23, 1, 1, -431, 384], - [23, 1, 1, -766, 89], - [23, 1, 1, -415, -232], - [23, 1, 1, -72, 135], - [23, 1, 1, 721, 414], - [23, 1, 1, 328, 77], - [23, 1, 1, 1025, 60], - [23, 1, 1, 677, -247], - [23, 1, 1, 104, 390], - [23, 1, 1, 84, -265], - ], - [ - [24, 1, 1, -429, 353], - [24, 1, 1, 241, 323], - [24, 1, 1, -472, 46], - [24, 1, 1, -27, 35], - [24, 1, 1, 563, 39], - [24, 1, 1, -268, -245], - [24, 1, 1, 172, -260], - ], - [ - [25, 1, 1, -595, 276], - [25, 1, 1, 115, 291], - [25, 1, 1, -192, -64], - [25, 1, 1, 464, -46], - [25, 1, 1, 191, -280], - [25, 1, 1, 884, -319], - ], - [ - [26, 1, 1, -681, 441], - [26, 1, 1, 685, 426], - [26, 1, 1, -46, 140], - [26, 1, 1, -494, -207], - [26, 1, 1, 497, -238], - ], - [ - [27, 1, 1, -431, 345], - [27, 1, 1, 569, 311], - [27, 1, 1, 112, -12], - [27, 1, 1, -298, -271], - [27, 1, 1, 678, -244], - ], - [ - [28, 1, 1, -454, 8], - [28, 1, 1, 597, 1], - [28, 1, 1, 46, 431], - [28, 1, 1, 44, -227], - ], - [ - [2, 1, 1, -557, 409], - [2, 1, 1, -648, 382], - [2, 1, 1, -732, 338], - [2, 1, 1, -809, 236], - [2, 1, 1, -861, 157], - [2, 1, 1, -865, 18], - [2, 1, 1, -835, -37], - [2, 1, 1, -787, -86], - [2, 1, 1, -746, -115], - [2, 1, 1, -683, -181], - [2, 1, 1, -575, -206], - [2, 1, 1, -494, -204], - [2, 1, 1, -442, -157], - [2, 1, 1, -403, -111], - [2, 1, 1, -387, 11], - [2, 1, 1, -356, 94], - [2, 1, 1, -472, 330], - [2, 1, 1, -407, 260], - [2, 1, 1, -395, 195], - [2, 1, 1, -214, 51], - [2, 1, 1, -139, 52], - [2, 1, 1, -77, 51], - [2, 1, 1, -21, 51], - [2, 1, 1, 67, 50], - [2, 1, 1, 107, 50], - [2, 1, 1, -40, 332], - [2, 1, 1, -43, 207], - [2, 1, 1, -60, 154], - [2, 1, 1, -60, 5], - [2, 1, 1, -82, -71], - [2, 1, 1, -77, -195], - [5, 1, 1, 427, 311], - [5, 1, 1, 578, 314], - [5, 1, 1, 779, 315], - [5, 1, 1, 862, 315], - [5, 1, 1, 884, 123], - [5, 1, 1, 879, -108], - [5, 1, 1, 778, -183], - [5, 1, 1, 672, -181], - [5, 1, 1, 564, -179], - [5, 1, 1, 407, -178], - [5, 1, 1, 297, 8], - [5, 1, 1, 625, 48], - [5, 1, 1, 379, 92], - ], - ] - private static formatMapConfig: Array = [] - private static config: Array>> = [ - // 左边开始 - [ - [-1309, 528], - [-1144, 438], - [-1081, 411], - [-947, 327], - [-801, 241], - [-683, 154], - [-539, 69], - [-394, -23], - [-230, -115], - [-115, -207], - [45, -280], - [247, -364], - [497, -457], - [627, -511], - [762, -578], - [885, -667], - [1068, -773], - ], - [ - [-1295, 534], - [-1144, 438], - [-1081, 411], - [-906, 326], - [-696, 274], - [-462, 223], - [-213, 198], - [-1, 172], - [156, 178], - [396, 194], - [576, 216], - [753, 233], - [936, 279], - [1182, 350], - [1314, 418], - ], - [ - [-1295, 534], - [-1144, 438], - [-1081, 411], - [-906, 326], - [-696, 274], - [-462, 223], - [-213, 198], - [-1, 172], - [199, 150], - [417, 111], - [635, 10], - [827, -42], - [1020, -131], - [1189, -170], - [1309, -198], - ], - [ - [-1295, 534], - [-1111, 514], - [-1015, 454], - [-864, 403], - [-671, 387], - [-450, 354], - [-219, 311], - [11, 274], - [213, 270], - [471, 212], - [642, 172], - [835, 88], - [1013, -2], - [1212, -99], - [1309, -198], - ], - [ - [-1275, -118], - [-1129, -19], - [-1024, 42], - [-858, 129], - [-677, 225], - [-448, 277], - [-219, 311], - [11, 274], - [213, 270], - [510, 320], - [596, 350], - [772, 391], - [887, 426], - [1066, 513], - [1164, 710], - ], - [ - [-1299, -618], - [-1143, -521], - [-1033, -496], - [-726, -425], - [-489, -360], - [-245, -293], - [-8, -210], - [212, -134], - [385, -65], - [552, 7], - [705, 96], - [904, 176], - [1090, 273], - [1208, 355], - [1308, 435], - ], - [ - [-1275, -118], - [-1060, -69], - [-938, -85], - [-729, -59], - [-551, -48], - [-397, -2], - [-203, -1], - [46, 61], - [228, 105], - [506, 159], - [630, 208], - [784, 266], - [935, 228], - [1157, 174], - [1329, 163], - ], - [ - [-1288, -220], - [-1113, -194], - [-945, -195], - [-709, -162], - [-502, -200], - [-313, -211], - [-144, -186], - [128, -135], - [314, 14], - [571, 56], - [727, 132], - [851, 203], - [1050, 141], - [1255, 58], - [1326, 20], - ], - [ - [-1288, -220], - [-1113, -194], - [-945, -195], - [-709, -162], - [-502, -200], - [-313, -211], - [-144, -186], - [132, -144], - [406, -196], - [644, -272], - [884, -272], - [993, -283], - [1090, -319], - [1242, -341], - [1329, -396], - ], - [ - [-1288, -220], - [-1113, -194], - [-916, -213], - [-710, -238], - [-501, -273], - [-297, -289], - [-101, -312], - [173, -324], - [419, -339], - [653, -362], - [889, -390], - [1011, -407], - [1095, -418], - [1238, -539], - [1317, -663], - ], - [ - [-1314, -508], - [-1123, -480], - [-917, -443], - [-708, -379], - [-514, -361], - [-300, -319], - [-101, -307], - [155, -256], - [398, -248], - [645, -219], - [787, -178], - [980, -165], - [1086, -103], - [1093, 280], - [1026, 371], - [868, 631], - [648, 787], - ], - [ - [-1314, -508], - [-1130, -281], - [-898, -160], - [-693, -141], - [-561, -91], - [-384, -43], - [-187, 48], - [119, 32], - [298, -95], - [519, -135], - [744, -156], - [868, -97], - [1033, 55], - [1093, 280], - [1026, 371], - [868, 631], - [648, 787], - ], - [ - [-1314, -508], - [-1130, -281], - [-898, -160], - [-693, -141], - [-561, -91], - [-384, -43], - [-187, 48], - [119, 32], - [298, -95], - [519, -135], - [744, -156], - [872, -200], - [1060, -391], - [1150, -492], - [1301, -461], - ], - //右边开始 - [ - [1286, -293], - [1149, -184], - [952, -147], - [795, -130], - [536, -45], - [476, 57], - [467, 300], - [408, 500], - [405, 701], - ], - [ - [1345, 34], - [1189, -69], - [978, -94], - [820, -115], - [443, -66], - [267, -29], - [66, -79], - [-219, -287], - [-271, -693], - ], - [ - [1345, 34], - [1189, -69], - [978, -94], - [820, -115], - [443, -66], - [267, -29], - [66, -79], - [-215, -156], - [-444, -100], - [-725, -92], - [-963, -68], - [-1169, -46], - [-1325, -40], - ], - [ - [1345, 34], - [1189, -69], - [978, -94], - [820, -115], - [443, -66], - [267, -29], - [66, -79], - [-215, -156], - [-454, -156], - [-719, -199], - [-981, -264], - [-1180, -291], - [-1320, -367], - ], - [ - [1345, 34], - [1189, -69], - [978, -94], - [820, -115], - [413, -128], - [258, -147], - [60, -161], - [-254, -250], - [-493, -278], - [-707, -320], - [-961, -408], - [-1160, -449], - [-1309, -524], - ], - [ - [1345, 34], - [1189, -69], - [978, -94], - [820, -115], - [439, -173], - [267, -185], - [109, -251], - [-211, -307], - [-428, -408], - [-596, -448], - [-847, -604], - [-1019, -589], - [-1241, -695], - ], - [ - [1345, 34], - [1189, -69], - [951, -68], - [512, -86], - [159, -142], - [-56, -144], - [-362, -160], - [-569, -143], - [-772, -35], - [-898, 66], - [-1070, 219], - [-1181, 292], - [-1289, 558], - ], - [ - [1345, 34], - [1189, -69], - [951, -68], - [512, -86], - [159, -142], - [-56, -144], - [-310, -118], - [-530, -84], - [-654, -2], - [-806, 84], - [-905, 246], - [-1008, 375], - [-1021, 750], - ], - [ - [1297, 542], - [1181, 330], - [1041, 250], - [676, 110], - [429, -12], - [5, -105], - [-310, -118], - [-530, -84], - [-654, -2], - [-806, 84], - [-905, 246], - [-1008, 375], - [-1021, 750], - ], - [ - [1297, 542], - [1181, 330], - [1041, 250], - [676, 110], - [429, -12], - [7, -105], - [-310, -118], - [-530, -84], - [-655, -18], - [-806, 84], - [-927, 189], - [-1073, 291], - [-1318, 474], - ], - [ - [1297, 542], - [1181, 330], - [1041, 250], - [676, 110], - [429, -12], - [7, -105], - [-310, -118], - [-530, -84], - [-631, -85], - [-775, -77], - [-923, -28], - [-1133, -46], - [-1294, -10], - ], - [ - [1297, 542], - [1181, 330], - [1041, 250], - [676, 110], - [429, -12], - [243, -126], - [-141, -203], - [-340, -201], - [-500, -218], - [-616, -254], - [-854, -240], - [-1115, -272], - [-1312, -336], - ], - [ - [1297, 542], - [1181, 330], - [1041, 250], - [676, 110], - [429, -12], - [243, -126], - [-141, -203], - [-307, -229], - [-398, -281], - [-562, -321], - [-647, -446], - [-930, -540], - [-1073, -726], - ], - [ - [1293, -558], - [1192, -467], - [1069, -395], - [948, -305], - [733, -245], - [243, -126], - [-141, -203], - [-307, -229], - [-398, -281], - [-562, -321], - [-647, -446], - [-930, -540], - [-1073, -726], - ], - [ - [1293, -558], - [1192, -467], - [1069, -395], - [948, -305], - [733, -245], - [243, -126], - [-141, -203], - [-307, -229], - [-398, -281], - [-568, -262], - [-857, -301], - [-1055, -406], - [-1353, -380], - ], - [ - [1293, -558], - [1192, -467], - [1069, -395], - [948, -305], - [733, -245], - [243, -126], - [-141, -203], - [-307, -229], - [-426, -197], - [-590, -195], - [-905, -120], - [-1100, -72], - [-1300, 225], - ], - [ - [1293, -558], - [1192, -467], - [1069, -395], - [948, -305], - [733, -245], - [243, -126], - [-141, -203], - [-307, -229], - [-497, -179], - [-633, -130], - [-917, 33], - [-1079, 184], - [-1220, 412], - ], - [ - [1293, -558], - [1192, -467], - [1069, -395], - [948, -305], - [733, -245], - [243, -126], - [-141, -203], - [-307, -229], - [-461, -55], - [-602, -25], - [-857, 181], - [-921, 416], - [-909, 805], - ], - //下往上 - [ - [-279, -786], - [-92, -667], - [45, -582], - [618, -388], - [436, -239], - [176, -173], - [-141, -203], - [-307, -229], - [-461, -55], - [-602, -25], - [-857, 181], - [-921, 416], - [-909, 805], - ], - [ - [-279, -786], - [-92, -667], - [45, -582], - [618, -388], - [436, -239], - [176, -173], - [126, -95], - [-26, -92], - [-157, 40], - [-362, 152], - [-543, 358], - [-721, 502], - [-401, 770], - ], - [ - [-279, -786], - [-78, -718], - [133, -652], - [618, -388], - [436, -239], - [392, -130], - [254, -77], - [194, -49], - [79, 44], - [60, 214], - [-85, 418], - [-140, 630], - [-401, 770], - ], - [ - [-279, -786], - [-78, -718], - [133, -652], - [618, -388], - [459, -232], - [392, -130], - [304, -80], - [267, -2], - [222, 130], - [253, 319], - [330, 465], - [544, 684], - [858, 803], - ], - [ - [841, -837], - [683, -745], - [672, -600], - [618, -388], - [459, -232], - [392, -130], - [304, -80], - [267, -2], - [222, 130], - [253, 319], - [330, 465], - [544, 684], - [858, 803], - ], - ] - private static formatConfig: Array = [] + private static mapConfig: Array>> = [ + [ + [1, 1, 1, -425, 387], + [1, 1, 1, -487, 352], + [1, 1, 1, -541, 307], + [1, 1, 1, -589, 263], + [1, 1, 1, -623, 232], + [1, 1, 1, -654, 172], + [1, 1, 1, -671, 134], + [1, 1, 1, -693, 92], + [1, 1, 1, -697, 35], + [1, 1, 1, -706, -19], + [1, 1, 1, -707, -92], + [1, 1, 1, -701, -136], + [1, 1, 1, -702, -177], + [1, 1, 1, -686, -230], + [1, 1, 1, -637, -257], + [1, 1, 1, -559, -272], + [1, 1, 1, -471, -278], + [1, 1, 1, -408, -259], + [1, 1, 1, -337, -226], + [1, 1, 1, -325, -170], + [1, 1, 1, -322, -99], + [1, 1, 1, -336, -39], + [1, 1, 1, -370, 7], + [1, 1, 1, -412, 59], + [1, 1, 1, -532, 69], + [1, 1, 1, -613, 82], + [1, 1, 1, -470, 63], + [1, 1, 1, 241, 402], + [1, 1, 1, 184, 357], + [1, 1, 1, 143, 335], + [1, 1, 1, 81, 285], + [1, 1, 1, 27, 229], + [1, 1, 1, -9, 167], + [1, 1, 1, -39, 126], + [1, 1, 1, -47, 57], + [1, 1, 1, -74, -10], + [1, 1, 1, -62, -66], + [1, 1, 1, -74, -118], + [1, 1, 1, -85, -201], + [1, 1, 1, -30, -240], + [1, 1, 1, 10, -271], + [1, 1, 1, 135, -273], + [1, 1, 1, 79, -280], + [1, 1, 1, 202, -280], + [1, 1, 1, 266, -276], + [1, 1, 1, 276, -274], + [1, 1, 1, 307, -259], + [1, 1, 1, 316, -244], + [1, 1, 1, 327, -226], + [1, 1, 1, 335, -195], + [1, 1, 1, 337, -142], + [1, 1, 1, 321, -53], + [1, 1, 1, 271, -13], + [1, 1, 1, 188, 27], + [1, 1, 1, 123, 46], + [1, 1, 1, 59, 57], + [1, 1, 1, 17, 60], + [1, 1, 1, 323, -101], + [1, 1, 1, 732, 329], + [1, 1, 1, 669, 283], + [1, 1, 1, 613, 218], + [1, 1, 1, 567, 185], + [1, 1, 1, 558, 163], + [1, 1, 1, 507, 95], + [1, 1, 1, 468, 35], + [1, 1, 1, 456, -18], + [1, 1, 1, 451, -80], + [1, 1, 1, 447, -164], + [1, 1, 1, 458, -234], + [1, 1, 1, 505, -267], + [1, 1, 1, 578, -281], + [1, 1, 1, 657, -291], + [1, 1, 1, 708, -291], + [1, 1, 1, 769, -291], + [1, 1, 1, 812, -290], + [1, 1, 1, 847, -275], + [1, 1, 1, 860, -236], + [1, 1, 1, 853, -160], + [1, 1, 1, 826, -95], + [1, 1, 1, 794, -46], + [1, 1, 1, 754, -7], + [1, 1, 1, 671, 26], + [1, 1, 1, 630, 59], + [1, 1, 1, 584, 80] + ], + [ + [2, 1, 1, -784, 353], + [2, 1, 1, -693, 356], + [2, 1, 1, -614, 354], + [2, 1, 1, -510, 354], + [2, 1, 1, -422, 354], + [2, 1, 1, -456, 287], + [2, 1, 1, -510, 199], + [2, 1, 1, -562, 139], + [2, 1, 1, -600, 82], + [2, 1, 1, -636, 38], + [2, 1, 1, -688, -17], + [2, 1, 1, -745, -92], + [2, 1, 1, -764, -152], + [2, 1, 1, -815, -216], + [2, 1, 1, -166, 341], + [2, 1, 1, -17, 343], + [2, 1, 1, 89, 343], + [2, 1, 1, 246, 331], + [2, 1, 1, 326, 348], + [2, 1, 1, -180, 310], + [2, 1, 1, -144, 209], + [2, 1, 1, -112, 151], + [2, 1, 1, -74, 55], + [2, 1, 1, -48, 0], + [2, 1, 1, 4, -91], + [2, 1, 1, 40, -153], + [2, 1, 1, 85, -201], + [2, 1, 1, 102, -247], + [3, 1, 1, 595, 319], + [3, 1, 1, 664, 322], + [3, 1, 1, 799, 318], + [3, 1, 1, 968, 319], + [3, 1, 1, 963, 107], + [3, 1, 1, 955, -21], + [3, 1, 1, 948, -157], + [3, 1, 1, 940, -231], + [3, 1, 1, 795, -245], + [3, 1, 1, 685, -248], + [3, 1, 1, 610, -252], + [3, 1, 1, 523, -253], + [3, 1, 1, 172, 128], + [3, 1, 1, -357, 30], + [3, 1, 1, 582, 23] + ], + [ + [5, 1, 1, -888, 405], + [5, 1, 1, -806, 410], + [5, 1, 1, -718, 404], + [5, 1, 1, -658, 406], + [5, 1, 1, -661, 286], + [5, 1, 1, -661, 224], + [5, 1, 1, -664, 142], + [5, 1, 1, -688, -2], + [5, 1, 1, -687, -69], + [5, 1, 1, -697, -120], + [5, 1, 1, -981, 410], + [5, 1, 1, -503, 150], + [5, 1, 1, -432, 146], + [5, 1, 1, -362, 149], + [5, 1, 1, -259, 148], + [5, 1, 1, -192, 149], + [5, 1, 1, -341, 359], + [5, 1, 1, -353, 256], + [5, 1, 1, -354, 203], + [5, 1, 1, -361, 72], + [5, 1, 1, -371, -23], + [5, 1, 1, -387, -79], + [5, 1, 1, 18, 277], + [5, 1, 1, 7, 159], + [5, 1, 1, -7, 94], + [5, 1, 1, -19, -3], + [5, 1, 1, -27, -80], + [5, 1, 1, 177, 164], + [5, 1, 1, 248, 172], + [5, 1, 1, 355, 170], + [5, 1, 1, 153, 29], + [5, 1, 1, 230, 30], + [5, 1, 1, 327, 32], + [6, 1, 1, 548, 371], + [6, 1, 1, 682, 374], + [6, 1, 1, 833, 373], + [6, 1, 1, 942, 374], + [6, 1, 1, 935, 289], + [6, 1, 1, 924, 143], + [6, 1, 1, 903, 65], + [6, 1, 1, 887, -44], + [6, 1, 1, 857, -157], + [6, 1, 1, 526, 109], + [6, 1, 1, 612, 108], + [6, 1, 1, 761, 94], + [6, 1, 1, 710, 260], + [6, 1, 1, 673, 177], + [6, 1, 1, 661, 10], + [6, 1, 1, 634, -61], + [6, 1, 1, 617, -138], + [7, 1, 1, 340, -259], + [7, 1, 1, 485, -254], + [7, 1, 1, 622, -254], + [7, 1, 1, 816, -251] + ], + [ + [9, 1, 1, -513, 150], + [9, 1, 1, -636, 237], + [9, 1, 1, -811, 250], + [9, 1, 1, -860, 145], + [9, 1, 1, -850, -54], + [9, 1, 1, -801, -154], + [9, 1, 1, -673, -268], + [9, 1, 1, -498, -294], + [9, 1, 1, -358, -223], + [9, 1, 1, -207, -127], + [9, 1, 1, -72, 15], + [9, 1, 1, -88, 196], + [9, 1, 1, -240, 285], + [9, 1, 1, -334, 185], + [9, 1, 1, 466, 151], + [9, 1, 1, 310, 202], + [9, 1, 1, 213, 246], + [9, 1, 1, 106, 83], + [9, 1, 1, 141, -54], + [9, 1, 1, 241, -252], + [9, 1, 1, 388, -285], + [9, 1, 1, 605, -295], + [9, 1, 1, 771, -226], + [9, 1, 1, 846, -125], + [9, 1, 1, 893, 51], + [9, 1, 1, 865, 195], + [9, 1, 1, 665, 207], + [17, 1, 1, -461, 2], + [17, 1, 1, 515, -49] + ], + [ + [19, 1, 1, -785, 31], + [19, 1, 1, 905, 16], + [20, 1, 1, -242, 34], + [20, 1, 1, 228, 12], + [20, 1, 1, -30, 303], + [20, 1, 1, -109, -292], + [20, 1, 1, 425, -301], + [20, 1, 1, 537, 265], + [20, 1, 1, -604, 317], + [20, 1, 1, -634, -285] + ], + [ + [21, 1, 1, -757, 94], + [21, 1, 1, 646, 55], + [21, 1, 1, -41, 376], + [21, 1, 1, -102, -315], + [21, 1, 1, -76, 83], + [21, 1, 1, -437, 300], + [21, 1, 1, -434, -155], + [21, 1, 1, 314, -154], + [21, 1, 1, 435, 249] + ], + [ + [22, 1, 1, -548, 65], + [22, 1, 1, 747, 61], + [22, 1, 1, 95, 63] + ], + [ + [23, 1, 1, -431, 384], + [23, 1, 1, -766, 89], + [23, 1, 1, -415, -232], + [23, 1, 1, -72, 135], + [23, 1, 1, 721, 414], + [23, 1, 1, 328, 77], + [23, 1, 1, 1025, 60], + [23, 1, 1, 677, -247], + [23, 1, 1, 104, 390], + [23, 1, 1, 84, -265] + ], + [ + [24, 1, 1, -429, 353], + [24, 1, 1, 241, 323], + [24, 1, 1, -472, 46], + [24, 1, 1, -27, 35], + [24, 1, 1, 563, 39], + [24, 1, 1, -268, -245], + [24, 1, 1, 172, -260] + ], + [ + [25, 1, 1, -595, 276], + [25, 1, 1, 115, 291], + [25, 1, 1, -192, -64], + [25, 1, 1, 464, -46], + [25, 1, 1, 191, -280], + [25, 1, 1, 884, -319] + ], + [ + [26, 1, 1, -681, 441], + [26, 1, 1, 685, 426], + [26, 1, 1, -46, 140], + [26, 1, 1, -494, -207], + [26, 1, 1, 497, -238] + ], + [ + [27, 1, 1, -431, 345], + [27, 1, 1, 569, 311], + [27, 1, 1, 112, -12], + [27, 1, 1, -298, -271], + [27, 1, 1, 678, -244] + ], + [ + [28, 1, 1, -454, 8], + [28, 1, 1, 597, 1], + [28, 1, 1, 46, 431], + [28, 1, 1, 44, -227] + ], + [ + [2, 1, 1, -557, 409], + [2, 1, 1, -648, 382], + [2, 1, 1, -732, 338], + [2, 1, 1, -809, 236], + [2, 1, 1, -861, 157], + [2, 1, 1, -865, 18], + [2, 1, 1, -835, -37], + [2, 1, 1, -787, -86], + [2, 1, 1, -746, -115], + [2, 1, 1, -683, -181], + [2, 1, 1, -575, -206], + [2, 1, 1, -494, -204], + [2, 1, 1, -442, -157], + [2, 1, 1, -403, -111], + [2, 1, 1, -387, 11], + [2, 1, 1, -356, 94], + [2, 1, 1, -472, 330], + [2, 1, 1, -407, 260], + [2, 1, 1, -395, 195], + [2, 1, 1, -214, 51], + [2, 1, 1, -139, 52], + [2, 1, 1, -77, 51], + [2, 1, 1, -21, 51], + [2, 1, 1, 67, 50], + [2, 1, 1, 107, 50], + [2, 1, 1, -40, 332], + [2, 1, 1, -43, 207], + [2, 1, 1, -60, 154], + [2, 1, 1, -60, 5], + [2, 1, 1, -82, -71], + [2, 1, 1, -77, -195], + [5, 1, 1, 427, 311], + [5, 1, 1, 578, 314], + [5, 1, 1, 779, 315], + [5, 1, 1, 862, 315], + [5, 1, 1, 884, 123], + [5, 1, 1, 879, -108], + [5, 1, 1, 778, -183], + [5, 1, 1, 672, -181], + [5, 1, 1, 564, -179], + [5, 1, 1, 407, -178], + [5, 1, 1, 297, 8], + [5, 1, 1, 625, 48], + [5, 1, 1, 379, 92] + ] + ] + private static formatMapConfig: Array = [] + private static config: Array>> = [ + // 左边开始 + [ + [-1309, 528], + [-1144, 438], + [-1081, 411], + [-947, 327], + [-801, 241], + [-683, 154], + [-539, 69], + [-394, -23], + [-230, -115], + [-115, -207], + [45, -280], + [247, -364], + [497, -457], + [627, -511], + [762, -578], + [885, -667], + [1068, -773] + ], + [ + [-1295, 534], + [-1144, 438], + [-1081, 411], + [-906, 326], + [-696, 274], + [-462, 223], + [-213, 198], + [-1, 172], + [156, 178], + [396, 194], + [576, 216], + [753, 233], + [936, 279], + [1182, 350], + [1314, 418] + ], + [ + [-1295, 534], + [-1144, 438], + [-1081, 411], + [-906, 326], + [-696, 274], + [-462, 223], + [-213, 198], + [-1, 172], + [199, 150], + [417, 111], + [635, 10], + [827, -42], + [1020, -131], + [1189, -170], + [1309, -198] + ], + [ + [-1295, 534], + [-1111, 514], + [-1015, 454], + [-864, 403], + [-671, 387], + [-450, 354], + [-219, 311], + [11, 274], + [213, 270], + [471, 212], + [642, 172], + [835, 88], + [1013, -2], + [1212, -99], + [1309, -198] + ], + [ + [-1275, -118], + [-1129, -19], + [-1024, 42], + [-858, 129], + [-677, 225], + [-448, 277], + [-219, 311], + [11, 274], + [213, 270], + [510, 320], + [596, 350], + [772, 391], + [887, 426], + [1066, 513], + [1164, 710] + ], + [ + [-1299, -618], + [-1143, -521], + [-1033, -496], + [-726, -425], + [-489, -360], + [-245, -293], + [-8, -210], + [212, -134], + [385, -65], + [552, 7], + [705, 96], + [904, 176], + [1090, 273], + [1208, 355], + [1308, 435] + ], + [ + [-1275, -118], + [-1060, -69], + [-938, -85], + [-729, -59], + [-551, -48], + [-397, -2], + [-203, -1], + [46, 61], + [228, 105], + [506, 159], + [630, 208], + [784, 266], + [935, 228], + [1157, 174], + [1329, 163] + ], + [ + [-1288, -220], + [-1113, -194], + [-945, -195], + [-709, -162], + [-502, -200], + [-313, -211], + [-144, -186], + [128, -135], + [314, 14], + [571, 56], + [727, 132], + [851, 203], + [1050, 141], + [1255, 58], + [1326, 20] + ], + [ + [-1288, -220], + [-1113, -194], + [-945, -195], + [-709, -162], + [-502, -200], + [-313, -211], + [-144, -186], + [132, -144], + [406, -196], + [644, -272], + [884, -272], + [993, -283], + [1090, -319], + [1242, -341], + [1329, -396] + ], + [ + [-1288, -220], + [-1113, -194], + [-916, -213], + [-710, -238], + [-501, -273], + [-297, -289], + [-101, -312], + [173, -324], + [419, -339], + [653, -362], + [889, -390], + [1011, -407], + [1095, -418], + [1238, -539], + [1317, -663] + ], + [ + [-1314, -508], + [-1123, -480], + [-917, -443], + [-708, -379], + [-514, -361], + [-300, -319], + [-101, -307], + [155, -256], + [398, -248], + [645, -219], + [787, -178], + [980, -165], + [1086, -103], + [1093, 280], + [1026, 371], + [868, 631], + [648, 787] + ], + [ + [-1314, -508], + [-1130, -281], + [-898, -160], + [-693, -141], + [-561, -91], + [-384, -43], + [-187, 48], + [119, 32], + [298, -95], + [519, -135], + [744, -156], + [868, -97], + [1033, 55], + [1093, 280], + [1026, 371], + [868, 631], + [648, 787] + ], + [ + [-1314, -508], + [-1130, -281], + [-898, -160], + [-693, -141], + [-561, -91], + [-384, -43], + [-187, 48], + [119, 32], + [298, -95], + [519, -135], + [744, -156], + [872, -200], + [1060, -391], + [1150, -492], + [1301, -461] + ], + //右边开始 + [ + [1286, -293], + [1149, -184], + [952, -147], + [795, -130], + [536, -45], + [476, 57], + [467, 300], + [408, 500], + [405, 701] + ], + [ + [1345, 34], + [1189, -69], + [978, -94], + [820, -115], + [443, -66], + [267, -29], + [66, -79], + [-219, -287], + [-271, -693] + ], + [ + [1345, 34], + [1189, -69], + [978, -94], + [820, -115], + [443, -66], + [267, -29], + [66, -79], + [-215, -156], + [-444, -100], + [-725, -92], + [-963, -68], + [-1169, -46], + [-1325, -40] + ], + [ + [1345, 34], + [1189, -69], + [978, -94], + [820, -115], + [443, -66], + [267, -29], + [66, -79], + [-215, -156], + [-454, -156], + [-719, -199], + [-981, -264], + [-1180, -291], + [-1320, -367] + ], + [ + [1345, 34], + [1189, -69], + [978, -94], + [820, -115], + [413, -128], + [258, -147], + [60, -161], + [-254, -250], + [-493, -278], + [-707, -320], + [-961, -408], + [-1160, -449], + [-1309, -524] + ], + [ + [1345, 34], + [1189, -69], + [978, -94], + [820, -115], + [439, -173], + [267, -185], + [109, -251], + [-211, -307], + [-428, -408], + [-596, -448], + [-847, -604], + [-1019, -589], + [-1241, -695] + ], + [ + [1345, 34], + [1189, -69], + [951, -68], + [512, -86], + [159, -142], + [-56, -144], + [-362, -160], + [-569, -143], + [-772, -35], + [-898, 66], + [-1070, 219], + [-1181, 292], + [-1289, 558] + ], + [ + [1345, 34], + [1189, -69], + [951, -68], + [512, -86], + [159, -142], + [-56, -144], + [-310, -118], + [-530, -84], + [-654, -2], + [-806, 84], + [-905, 246], + [-1008, 375], + [-1021, 750] + ], + [ + [1297, 542], + [1181, 330], + [1041, 250], + [676, 110], + [429, -12], + [5, -105], + [-310, -118], + [-530, -84], + [-654, -2], + [-806, 84], + [-905, 246], + [-1008, 375], + [-1021, 750] + ], + [ + [1297, 542], + [1181, 330], + [1041, 250], + [676, 110], + [429, -12], + [7, -105], + [-310, -118], + [-530, -84], + [-655, -18], + [-806, 84], + [-927, 189], + [-1073, 291], + [-1318, 474] + ], + [ + [1297, 542], + [1181, 330], + [1041, 250], + [676, 110], + [429, -12], + [7, -105], + [-310, -118], + [-530, -84], + [-631, -85], + [-775, -77], + [-923, -28], + [-1133, -46], + [-1294, -10] + ], + [ + [1297, 542], + [1181, 330], + [1041, 250], + [676, 110], + [429, -12], + [243, -126], + [-141, -203], + [-340, -201], + [-500, -218], + [-616, -254], + [-854, -240], + [-1115, -272], + [-1312, -336] + ], + [ + [1297, 542], + [1181, 330], + [1041, 250], + [676, 110], + [429, -12], + [243, -126], + [-141, -203], + [-307, -229], + [-398, -281], + [-562, -321], + [-647, -446], + [-930, -540], + [-1073, -726] + ], + [ + [1293, -558], + [1192, -467], + [1069, -395], + [948, -305], + [733, -245], + [243, -126], + [-141, -203], + [-307, -229], + [-398, -281], + [-562, -321], + [-647, -446], + [-930, -540], + [-1073, -726] + ], + [ + [1293, -558], + [1192, -467], + [1069, -395], + [948, -305], + [733, -245], + [243, -126], + [-141, -203], + [-307, -229], + [-398, -281], + [-568, -262], + [-857, -301], + [-1055, -406], + [-1353, -380] + ], + [ + [1293, -558], + [1192, -467], + [1069, -395], + [948, -305], + [733, -245], + [243, -126], + [-141, -203], + [-307, -229], + [-426, -197], + [-590, -195], + [-905, -120], + [-1100, -72], + [-1300, 225] + ], + [ + [1293, -558], + [1192, -467], + [1069, -395], + [948, -305], + [733, -245], + [243, -126], + [-141, -203], + [-307, -229], + [-497, -179], + [-633, -130], + [-917, 33], + [-1079, 184], + [-1220, 412] + ], + [ + [1293, -558], + [1192, -467], + [1069, -395], + [948, -305], + [733, -245], + [243, -126], + [-141, -203], + [-307, -229], + [-461, -55], + [-602, -25], + [-857, 181], + [-921, 416], + [-909, 805] + ], + //下往上 + [ + [-279, -786], + [-92, -667], + [45, -582], + [618, -388], + [436, -239], + [176, -173], + [-141, -203], + [-307, -229], + [-461, -55], + [-602, -25], + [-857, 181], + [-921, 416], + [-909, 805] + ], + [ + [-279, -786], + [-92, -667], + [45, -582], + [618, -388], + [436, -239], + [176, -173], + [126, -95], + [-26, -92], + [-157, 40], + [-362, 152], + [-543, 358], + [-721, 502], + [-401, 770] + ], + [ + [-279, -786], + [-78, -718], + [133, -652], + [618, -388], + [436, -239], + [392, -130], + [254, -77], + [194, -49], + [79, 44], + [60, 214], + [-85, 418], + [-140, 630], + [-401, 770] + ], + [ + [-279, -786], + [-78, -718], + [133, -652], + [618, -388], + [459, -232], + [392, -130], + [304, -80], + [267, -2], + [222, 130], + [253, 319], + [330, 465], + [544, 684], + [858, 803] + ], + [ + [841, -837], + [683, -745], + [672, -600], + [618, -388], + [459, -232], + [392, -130], + [304, -80], + [267, -2], + [222, 130], + [253, 319], + [330, 465], + [544, 684], + [858, 803] + ] + ] + private static formatConfig: Array = [] - public static init() { - this.initNormalConfig() - this.initMapConfig() - } + public static init() { + this.initNormalConfig() + this.initMapConfig() + } - private static initMapConfig() { - this.formatMapConfig = [] - for (let i = 0; i < this.mapConfig.length; i++) { - let arr: Array> = this.mapConfig[i] - let fishMapInfoList: Array = [] - for (let j = 0; j < arr.length; j++) { - let temp: Array = arr[j] - let fishMapInfo: FishMapInfo = new FishMapInfo( - temp[0], - temp[1], - temp[2], - temp[3], - temp[4] - ) - fishMapInfoList.push(fishMapInfo) - } - let fishMap: FishMap = new FishMap(i, fishMapInfoList) - this.formatMapConfig.push(fishMap) - } - } + private static initMapConfig() { + this.formatMapConfig = [] + for (let i = 0; i < this.mapConfig.length; i++) { + let arr: Array> = this.mapConfig[i] + let fishMapInfoList: Array = [] + for (let j = 0; j < arr.length; j++) { + let temp: Array = arr[j] + let fishMapInfo: FishMapInfo = new FishMapInfo( + temp[0], + temp[1], + temp[2], + temp[3], + temp[4] + ) + fishMapInfoList.push(fishMapInfo) + } + let fishMap: FishMap = new FishMap(i, fishMapInfoList) + this.formatMapConfig.push(fishMap) + } + } - public static randomFishMap() { - let randomIndex: number = RandomUtil.nextInt( - 0, - this.formatMapConfig.length - 1 - ) - let map: FishMap = this.formatMapConfig[randomIndex] - return map - } + public static randomFishMap() { + let randomIndex: number = RandomUtil.nextInt( + 0, + this.formatMapConfig.length - 1 + ) + let map: FishMap = this.formatMapConfig[randomIndex] + return map + } - private static initNormalConfig() { - this.formatConfig = [] - let pathId: number = 1 - for (let i = 0; i < this.config.length; i++) { - let path: Array = [] - let flipXPath: Array = [] - let flipYPath: Array = [] - for (let j = 0; j < this.config[i].length; j++) { - let p: Vec2 = new Vec2(this.config[i][j][0], this.config[i][j][1]) - path.push(p) - let flipXP: Vec2 = new Vec2(-p.x, p.y) - let flipYP: Vec2 = new Vec2(p.x, -p.y) - flipXPath.push(flipXP) - flipYPath.push(flipYP) - } - this.formatConfig.push(new FishPathInfo(pathId++, path)) - this.formatConfig.push(new FishPathInfo(pathId++, flipXPath)) - this.formatConfig.push(new FishPathInfo(pathId++, flipYPath)) - } - } + private static initNormalConfig() { + this.formatConfig = [] + let pathId: number = 1 + for (let i = 0; i < this.config.length; i++) { + let path: Array = [] + let flipXPath: Array = [] + let flipYPath: Array = [] + for (let j = 0; j < this.config[i].length; j++) { + let p: Vec2 = new Vec2(this.config[i][j][0], this.config[i][j][1]) + path.push(p) + let flipXP: Vec2 = new Vec2(-p.x, p.y) + let flipYP: Vec2 = new Vec2(p.x, -p.y) + flipXPath.push(flipXP) + flipYPath.push(flipYP) + } + this.formatConfig.push(new FishPathInfo(pathId++, path)) + this.formatConfig.push(new FishPathInfo(pathId++, flipXPath)) + this.formatConfig.push(new FishPathInfo(pathId++, flipYPath)) + } + } - public static getPathInfo(pathId: number) { - for (let i = 0; i < this.formatConfig.length; i++) { - let pathInfo: FishPathInfo = this.formatConfig[i] - if (pathInfo.pathId == pathId) { - return pathInfo - } - } - } + public static getPathInfo(pathId: number) { + for (let i = 0; i < this.formatConfig.length; i++) { + let pathInfo: FishPathInfo = this.formatConfig[i] + if (pathInfo.pathId == pathId) { + return pathInfo + } + } + } - public static randomPathInfo() { - let randomIndex: number = RandomUtil.nextInt( - 0, - this.formatConfig.length - 1 - ) - // let randomIndex: number = 0 - let pathInfo: FishPathInfo = this.formatConfig[randomIndex] - return pathInfo - } + public static randomPathInfo() { + let randomIndex: number = RandomUtil.nextInt( + 0, + this.formatConfig.length - 1 + ) + // let randomIndex: number = 0 + let pathInfo: FishPathInfo = this.formatConfig[randomIndex] + return pathInfo + } } diff --git a/assets/FishSingle/script/game/config/FishPathInfo.ts b/assets/FishSingle/script/game/config/FishPathInfo.ts index f407fba..aa4089d 100644 --- a/assets/FishSingle/script/game/config/FishPathInfo.ts +++ b/assets/FishSingle/script/game/config/FishPathInfo.ts @@ -1,9 +1,11 @@ -import { _decorator, Vec2 } from 'cc' +import { Vec2 } from 'cc' + export class FishPathInfo { - public pathId: number - public path: Array = [] - constructor(pathId: number, path: Array) { - this.pathId = pathId - this.path = path - } + public pathId: number + public path: Array = [] + + constructor(pathId: number, path: Array) { + this.pathId = pathId + this.path = path + } } diff --git a/assets/FishSingle/script/game/config/GameConfig.ts b/assets/FishSingle/script/game/config/GameConfig.ts index 55f75af..d82ea98 100644 --- a/assets/FishSingle/script/game/config/GameConfig.ts +++ b/assets/FishSingle/script/game/config/GameConfig.ts @@ -1,4 +1,3 @@ -import { _decorator } from 'cc' export class GameConfig { - public static GameName: string = 'FishSingle' + public static GameName: string = 'FishSingle' } diff --git a/assets/FishSingle/script/game/config/GameEvent.ts b/assets/FishSingle/script/game/config/GameEvent.ts index 6d2fa85..55c2023 100644 --- a/assets/FishSingle/script/game/config/GameEvent.ts +++ b/assets/FishSingle/script/game/config/GameEvent.ts @@ -1,2 +1,2 @@ -import { _decorator } from 'cc' -export default class GameEvent {} +export default class GameEvent { +} diff --git a/assets/FishSingle/script/game/manager/BulletManager.ts b/assets/FishSingle/script/game/manager/BulletManager.ts index a67af38..e32d60f 100644 --- a/assets/FishSingle/script/game/manager/BulletManager.ts +++ b/assets/FishSingle/script/game/manager/BulletManager.ts @@ -1,21 +1,16 @@ import { - _decorator, - Component, - Prefab, - NodePool, - Event, - Node, - Vec3, - Vec2, - EventTouch, - UITransform, - instantiate, - sys, - error, + _decorator, + Component, + EventTouch, + instantiate, + Node, + NodePool, + Prefab, + sys, + UITransform, + Vec2, + Vec3 } from 'cc' -const { ccclass, property } = _decorator - -import { Logger } from '../../engine/utils/Logger' import FishBulletBase from '../../../fish/script/FishBulletBase' import MathUtils from '../../engine/utils/MathUtils' import CannonManager from './CannonManager' @@ -25,136 +20,140 @@ import GameMusicHelper from '../utils/GameMusicHelper' import FishUI from '../../../fish/script/FishUI' import CommonTips from '../../engine/uicomponent/CommonTips' +const { ccclass, property } = _decorator + @ccclass('BulletManager') export default class BulletManager extends Component { - public static instance: BulletManager = null - @property({ type: [Prefab] }) - private bulletPrefabList: Prefab[] = [] - private bulletPool: Array = [] - private bulletList: Array = [] - private bulletMoveSpeed: number = 30 - private _vec3Cache - private _vec2Cache - private _fireTime: number = 0 - private _fireTimeNew: number - onLoad() { - this._vec3Cache = new Vec3() - this._vec2Cache = new Vec2() - BulletManager.instance = this - this.node.on(Node.EventType.TOUCH_START, this.onShootBullet, this) - // this.node.on(Node.EventType.TOUCH_MOVE, this.onShootBullet, this) - } + public static instance: BulletManager = null + @property({ type: [Prefab] }) + private bulletPrefabList: Prefab[] | [] = [] + private bulletPool: Array = [] + private bulletList: Array = [] + private bulletMoveSpeed: number = 30 + private _vec3Cache: Vec3 + private _vec2Cache: Vec2 + private _fireTime: number = 0 + private _fireTimeNew: number - start() {} + onLoad() { + this._vec3Cache = new Vec3() + this._vec2Cache = new Vec2() + BulletManager.instance = this + this.node.on(Node.EventType.TOUCH_START, this.onShootBullet, this) + // this.node.on(Node.EventType.TOUCH_MOVE, this.onShootBullet, this) + } - update() { - this.checkMoveBullet() - } + start() { + } - private checkMoveBullet() { - for (let i = this.bulletList.length - 1; i >= 0; i--) { - let bullet: FishBulletBase = this.bulletList[i] - let isMoving: boolean = MoveHelper.moveNode( - bullet.node, - this.bulletMoveSpeed, - bullet.targetP.x, - bullet.targetP.y - ) - if (!isMoving) { - bullet.node.getPosition(this._vec3Cache) - this._vec2Cache.x = this._vec3Cache.x - this._vec2Cache.y = this._vec3Cache.y - FishNetManager.instance.addFishNet(bullet.bulletType, this._vec2Cache) - this.bulletList.splice(i, 1) - this.destroyBullet(bullet) - } - } - } + update() { + this.checkMoveBullet() + } - private onShootBullet(event: EventTouch) { - //TOUCH_START 在Editor上,连续触发2次,导致发2次炮弹bug - if (sys.platform == 'EDITOR_PAGE') { - this._fireTimeNew = new Date().getTime() - if (this._fireTimeNew - this._fireTime < 100) { - return - } - this._fireTime = this._fireTimeNew - } + private checkMoveBullet() { + for (let i = this.bulletList.length - 1; i >= 0; i--) { + let bullet: FishBulletBase = this.bulletList[i] + let isMoving: boolean = MoveHelper.moveNode( + bullet.node, + this.bulletMoveSpeed, + bullet.targetP.x, + bullet.targetP.y + ) + if (!isMoving) { + bullet.node.getPosition(this._vec3Cache) + this._vec2Cache.x = this._vec3Cache.x + this._vec2Cache.y = this._vec3Cache.y + FishNetManager.instance.addFishNet(bullet.bulletType, this._vec2Cache) + this.bulletList.splice(i, 1) + this.destroyBullet(bullet) + } + } + } - let tran = this.node.getComponent(UITransform) - let location = event.getUILocation() - this._vec3Cache.x = location.x - this._vec3Cache.y = location.y - this._vec3Cache.z = 0 - tran.convertToNodeSpaceAR(this._vec3Cache, this._vec3Cache) - let localP: Vec2 = new Vec2(this._vec3Cache.x, this._vec3Cache.y) - FishUI.instance.playClickEffect(localP) - // 子弹发射 - if (FishUI.instance.dz_score >= CannonManager.instance.cannonType) { - FishUI.instance.dz_score -= CannonManager.instance.cannonType - FishUI.instance.refreshScore() - this._vec3Cache = CannonManager.instance.getCannonPosition() + private onShootBullet(event: EventTouch) { + //TOUCH_START 在Editor上,连续触发2次,导致发2次炮弹bug + if (sys.platform == 'EDITOR_PAGE') { + this._fireTimeNew = new Date().getTime() + if (this._fireTimeNew - this._fireTime < 100) { + return + } + this._fireTime = this._fireTimeNew + } - let rad: number = MathUtils.p2pRad( - new Vec2(this._vec3Cache.x, this._vec3Cache.y), - localP - ) - let rot: number = MathUtils.radiansToDegrees(rad) - let bullet: FishBulletBase = this.createBullet( - CannonManager.instance.cannonType - 1 - ) - bullet.targetP = localP - this.node.addChild(bullet.node) - bullet.node.setPosition(CannonManager.instance.getCannonPosition()) - this._vec3Cache.x = 1 - this._vec3Cache.y = 1 - this._vec3Cache.y = 1 - Vec3.multiplyScalar(this._vec3Cache, this._vec3Cache, 2) - bullet.node.setScale(this._vec3Cache) - bullet.node.angle = rot - this.bulletList.push(bullet) - GameMusicHelper.playFire() + let tran = this.node.getComponent(UITransform) + let location = event.getUILocation() + this._vec3Cache.x = location.x + this._vec3Cache.y = location.y + this._vec3Cache.z = 0 + tran.convertToNodeSpaceAR(this._vec3Cache, this._vec3Cache) + let localP: Vec2 = new Vec2(this._vec3Cache.x, this._vec3Cache.y) + FishUI.instance.playClickEffect(localP) + // 子弹发射 + if (FishUI.instance.dz_score >= CannonManager.instance.cannonType) { + FishUI.instance.dz_score -= CannonManager.instance.cannonType + FishUI.instance.refreshScore() + this._vec3Cache = CannonManager.instance.getCannonPosition() - //旋转炮台 - CannonManager.instance.rotateCannon(location) - } else { - CommonTips.showMsg('豆子不足!') - } - } + let rad: number = MathUtils.p2pRad( + new Vec2(this._vec3Cache.x, this._vec3Cache.y), + localP + ) + let rot: number = MathUtils.radiansToDegrees(rad) + let bullet: FishBulletBase = this.createBullet( + CannonManager.instance.cannonType - 1 + ) + bullet.targetP = localP + this.node.addChild(bullet.node) + bullet.node.setPosition(CannonManager.instance.getCannonPosition()) + this._vec3Cache.x = 1 + this._vec3Cache.y = 1 + this._vec3Cache.y = 1 + Vec3.multiplyScalar(this._vec3Cache, this._vec3Cache, 2) + bullet.node.setScale(this._vec3Cache) + bullet.node.angle = rot + this.bulletList.push(bullet) + GameMusicHelper.playFire() - private createBullet(bulletType: number) { - let bulletNode: Node - if (this.bulletPool[bulletType] && this.bulletPool[bulletType].size() > 0) { - bulletNode = this.bulletPool[bulletType].get() - } else { - bulletNode = instantiate(this.bulletPrefabList[bulletType]) - } - bulletNode.getComponent(FishBulletBase).bulletType = bulletType - return bulletNode.getComponent(FishBulletBase) - } + //旋转炮台 + CannonManager.instance.rotateCannon(location) + } else { + CommonTips.showMsg('豆子不足!') + } + } - public killBullet(bullet: FishBulletBase) { - let index: number = this.bulletList.indexOf(bullet) - if (index >= 0) { - this.bulletList.splice(index, 1) - this.destroyBullet(bullet) - } - } + private createBullet(bulletType: number) { + let bulletNode: Node + if (this.bulletPool[bulletType] && this.bulletPool[bulletType].size() > 0) { + bulletNode = this.bulletPool[bulletType].get() + } else { + bulletNode = instantiate(this.bulletPrefabList[bulletType]) + } + bulletNode.getComponent(FishBulletBase).bulletType = bulletType + return bulletNode.getComponent(FishBulletBase) + } - private destroyBullet(bullet: FishBulletBase) { - //临时代码,因为回收在内存卡顿。后面在优化 2023-2-10 - if (sys.platform == 'EDITOR_PAGE') { - bullet.node.destroy() - return - } + public killBullet(bullet: FishBulletBase) { + let index: number = this.bulletList.indexOf(bullet) + if (index >= 0) { + this.bulletList.splice(index, 1) + this.destroyBullet(bullet) + } + } - if (!this.bulletPool[bullet.bulletType]) { - this.bulletPool[bullet.bulletType] = new NodePool() - } - this.bulletPool[bullet.bulletType].put(bullet.node) - } + private destroyBullet(bullet: FishBulletBase) { + //临时代码,因为回收在内存卡顿。后面在优化 2023-2-10 + if (sys.platform == 'EDITOR_PAGE') { + bullet.node.destroy() + return + } - onDestroy() { - BulletManager.instance = null - } + if (!this.bulletPool[bullet.bulletType]) { + this.bulletPool[bullet.bulletType] = new NodePool() + } + this.bulletPool[bullet.bulletType].put(bullet.node) + } + + onDestroy() { + BulletManager.instance = null + } } diff --git a/assets/FishSingle/script/game/manager/CannonManager.ts b/assets/FishSingle/script/game/manager/CannonManager.ts index 05c166c..4240cd3 100644 --- a/assets/FishSingle/script/game/manager/CannonManager.ts +++ b/assets/FishSingle/script/game/manager/CannonManager.ts @@ -1,66 +1,58 @@ -import { - _decorator, - Component, - Node, - SpriteFrame, - Event, - EventMouse, - Sprite, - Vec2, - UITransform, - Vec3, -} from 'cc' -const { ccclass, property } = _decorator - +import { _decorator, Component, EventMouse, Node, Sprite, SpriteFrame, UITransform, Vec2, Vec3 } from 'cc' import MathUtils from '../../engine/utils/MathUtils' +const { ccclass, property } = _decorator + @ccclass('CannonManager') export default class CannonManager extends Component { - public static instance: CannonManager = null - @property({ type: Node }) - private view: Node | null = null - @property({ type: [SpriteFrame] }) - private cannonSpriteFrame: Array = [] - // 炮塔倍数 - public cannonType: number = 1 - private _vec3Cache + public static instance: CannonManager = null + @property({ type: Node }) + private view: Node | null = null + @property({ type: [SpriteFrame] }) + private cannonSpriteFrame: Array | [] = [] + // 炮塔倍数 + public cannonType: number = 1 + private _vec3Cache: Vec3 - onLoad() { - this._vec3Cache = new Vec3() - CannonManager.instance = this - this.node.parent.on(Node.EventType.MOUSE_MOVE, this.onMeMove.bind(this)) - this.refreshCannon() - } - private onMeMove(event: EventMouse) { - this.rotateCannon(event.getUILocation()) - } + onLoad() { + this._vec3Cache = new Vec3() + CannonManager.instance = this + this.node.parent.on(Node.EventType.MOUSE_MOVE, this.onMeMove.bind(this)) + this.refreshCannon() + } - public rotateCannon(uilocation: Vec2) { - let location = uilocation - this._vec3Cache.x = location.x - this._vec3Cache.y = location.y - this._vec3Cache.z = 0 - let tran = this.node.getComponent(UITransform) - tran.convertToNodeSpaceAR(this._vec3Cache, this._vec3Cache) + private onMeMove(event: EventMouse) { + this.rotateCannon(event.getUILocation()) + } - let localTouch: Vec2 = new Vec2(this._vec3Cache.x, this._vec3Cache.y) - this.view.getPosition(this._vec3Cache) - let rad: number = MathUtils.p2pRad( - new Vec2(this._vec3Cache.x, this._vec3Cache.y), - localTouch - ) - let rot: number = MathUtils.radiansToDegrees(rad) - this.view.angle = rot - 90 - } + public rotateCannon(uilocation: Vec2) { + let location = uilocation + this._vec3Cache.x = location.x + this._vec3Cache.y = location.y + this._vec3Cache.z = 0 + let tran = this.node.getComponent(UITransform) + tran.convertToNodeSpaceAR(this._vec3Cache, this._vec3Cache) - public refreshCannon() { - this.view.getComponent(Sprite).spriteFrame = - this.cannonSpriteFrame[this.cannonType - 1] - } - public getCannonPosition() { - return this.view.getPosition() - } - onDestroy() { - CannonManager.instance = null - } + let localTouch: Vec2 = new Vec2(this._vec3Cache.x, this._vec3Cache.y) + this.view.getPosition(this._vec3Cache) + let rad: number = MathUtils.p2pRad( + new Vec2(this._vec3Cache.x, this._vec3Cache.y), + localTouch + ) + let rot: number = MathUtils.radiansToDegrees(rad) + this.view.angle = rot - 90 + } + + public refreshCannon() { + this.view.getComponent(Sprite).spriteFrame = + this.cannonSpriteFrame[this.cannonType - 1] + } + + public getCannonPosition() { + return this.view.getPosition() + } + + onDestroy() { + CannonManager.instance = null + } } diff --git a/assets/FishSingle/script/game/manager/FishManager.ts b/assets/FishSingle/script/game/manager/FishManager.ts index 804dec8..58fc8d5 100644 --- a/assets/FishSingle/script/game/manager/FishManager.ts +++ b/assets/FishSingle/script/game/manager/FishManager.ts @@ -1,21 +1,6 @@ -import { - _decorator, - Component, - Node, - Prefab, - NodePool, - game, - Vec3, - sys, - instantiate, - Animation, - Vec2, -} from 'cc' -const { ccclass, property } = _decorator - +import { _decorator, Animation, Component, game, instantiate, Node, NodePool, Prefab, Vec2, Vec3 } from 'cc' import RandomUtil from '../../engine/utils/RandomUtil' import FishBase from '../../../fish/script/FishBase' -import { FishPathInfo } from '../config/FishPathInfo' import { FishPathConfig } from '../config/FishPathConfig' import FishMover from '../../../fish/script/FishMover' import { Logger } from '../../engine/utils/Logger' @@ -28,195 +13,198 @@ import { FishMapInfo } from '../config/FishMapInfo' import FishUI from '../../../fish/script/FishUI' import TimeHelper from '../utils/TimeHelper' +const { ccclass, property } = _decorator + @ccclass('FishManager') export default class FishManager extends Component { - public static instance: FishManager = null - @property({ type: Node }) - private fishContainer: Node | null = null - @property({ type: [Prefab] }) - public fishPrefabList: Array = [] - private fishPool: Array = [] - private fishList: Array = [] - private nextRandomFishTime: number = 0 - private minRandomTime: number = 2 * (game.frameRate as number) - private maxRandomTime: number = 5 * (game.frameRate as number) - private isFishMap: boolean = false - private mapCount: number = 0 - private minMapCount: number = 30 * (game.frameRate as number) - private maxMapCount: number = 60 * (game.frameRate as number) - // // private minMapCount: number = 2 * cc.game.getFrameRate(); - // // private maxMapCount: number = 5 * cc.game.getFrameRate(); + public static instance: FishManager = null + @property({ type: Node }) + private fishContainer: Node | null = null + @property({ type: [Prefab] }) + public fishPrefabList: Array = [] + private fishPool: Array = [] + private fishList: Array = [] + private nextRandomFishTime: number = 0 + private minRandomTime: number = 2 * (game.frameRate as number) + private maxRandomTime: number = 5 * (game.frameRate as number) + private isFishMap: boolean = false + private mapCount: number = 0 + private minMapCount: number = 30 * (game.frameRate as number) + private maxMapCount: number = 60 * (game.frameRate as number) + // // private minMapCount: number = 2 * cc.game.getFrameRate(); + // // private maxMapCount: number = 5 * cc.game.getFrameRate(); - private _fishPosCache - onLoad() { - FishManager.instance = this - this._fishPosCache = new Vec3() - Logger.log( - 'maxRandomTime=', - this.minRandomTime, - this.maxRandomTime, - game.frameRate - ) - } + private _fishPosCache: Vec3 - start() { - this.randomFish() - } + onLoad() { + FishManager.instance = this + this._fishPosCache = new Vec3() + Logger.log( + 'maxRandomTime=', + this.minRandomTime, + this.maxRandomTime, + game.frameRate + ) + } - update() { - this.checkRandomFish() - this.checkFishMoveEnd() - this.checkFishMap() - } + start() { + this.randomFish() + } - private checkFishMap() { - if (!this.isFishMap) { - if (this.mapCount > 0) { - this.mapCount-- - if (this.mapCount <= 0) { - FishUI.instance.playWaveEffect() - } - } - } - } + update() { + this.checkRandomFish() + this.checkFishMoveEnd() + this.checkFishMap() + } - private checkRandomFish() { - if (!this.isFishMap) { - if (this.nextRandomFishTime > 0) { - this.nextRandomFishTime-- - if (this.nextRandomFishTime == 0) { - this.randomFish() - } - } - } - } + private checkFishMap() { + if (!this.isFishMap) { + if (this.mapCount > 0) { + this.mapCount-- + if (this.mapCount <= 0) { + FishUI.instance.playWaveEffect() + } + } + } + } - private checkFishMoveEnd() { - for (let i = this.fishList.length - 1; i >= 0; i--) { - let fish: FishBase = this.fishList[i] - if (this.isFishMap) { - if (!fish.isDead) { - fish.node.getPosition(this._fishPosCache) - this._fishPosCache.x -= 2 - fish.node.setPosition(this._fishPosCache) - if (this._fishPosCache.x <= -screen.width / 2) { - //winSize.width - this.destroyFish(fish) - this.fishList.splice(i, 1) - this.checkEndFishMap() - } - } - } else if (!fish.getComponent(FishMover).isMoving) { - this.destroyFish(fish) - this.fishList.splice(i, 1) - } - } - } + private checkRandomFish() { + if (!this.isFishMap) { + if (this.nextRandomFishTime > 0) { + this.nextRandomFishTime-- + if (this.nextRandomFishTime == 0) { + this.randomFish() + } + } + } + } - private checkEndFishMap() { - Logger.log('checkEndFishMap==', this.isFishMap, this.fishList) - if (this.isFishMap && this.fishList.length <= 0) { - this.isFishMap = false - this.randomFish() - } - } + private checkFishMoveEnd() { + for (let i = this.fishList.length - 1; i >= 0; i--) { + let fish: FishBase = this.fishList[i] + if (this.isFishMap) { + if (!fish.isDead) { + fish.node.getPosition(this._fishPosCache) + this._fishPosCache.x -= 2 + fish.node.setPosition(this._fishPosCache) + if (this._fishPosCache.x <= -screen.width / 2) { + //winSize.width + this.destroyFish(fish) + this.fishList.splice(i, 1) + this.checkEndFishMap() + } + } + } else if (!fish.getComponent(FishMover).isMoving) { + this.destroyFish(fish) + this.fishList.splice(i, 1) + } + } + } - private randomFish() { - if (this.isFishMap) return - let randomNum: number = RandomUtil.nextInt(1, 10) - // let randomNum: number = RandomUtil.nextInt(1, 1); - for (let i = 0; i < randomNum; i++) { - let fishType: number = RandomUtil.nextInt(1, 29) - // let fishType: number = RandomUtil.nextInt(1, 1); - let fish: FishBase = this.createFishByType(fishType) - fish.fishPathInfo = FishPathConfig.randomPathInfo() - this._fishPosCache.z = 0 - this._fishPosCache.x = fish.fishPathInfo.path[0].x - this._fishPosCache.y = fish.fishPathInfo.path[0].y - fish.node.setPosition(this._fishPosCache) - fish.getComponent(FishMover).bezierPList = fish.fishPathInfo.path - fish.getComponent(FishMover).startMove() - this.fishList.push(fish) - this.fishContainer.addChild(fish.node) - } - Logger.log('checkFishMoveEnd=randomFish=', this.fishList) - this.nextRandomFishTime = RandomUtil.nextInt( - this.minRandomTime, - this.maxRandomTime - ) - if (this.mapCount <= 0) { - this.mapCount = RandomUtil.nextInt(this.minMapCount, this.maxMapCount) - } - } + private checkEndFishMap() { + Logger.log('checkEndFishMap==', this.isFishMap, this.fishList) + if (this.isFishMap && this.fishList.length <= 0) { + this.isFishMap = false + this.randomFish() + } + } - public createFishByType(fishType: number): FishBase { - let fishNode: Node - if (this.fishPool[fishType - 1] && this.fishPool[fishType - 1].size() > 0) { - fishNode = this.fishPool[fishType - 1].get() - } else { - fishNode = instantiate(this.fishPrefabList[fishType - 1]) - } - //fishNode.getComponent(Animation).play() //v3 当前帧 不能播放 - TimeHelper.exeNextFrame(fishNode, () => - fishNode.getComponent(Animation).play() - ) - let fishInfo: FishInfo = FishConfig.getFishInfoByType(fishType) - fishNode.getComponent(FishBase).fishInfo = fishInfo - fishNode.getComponent(FishBase).fishType = fishType - fishNode.getComponent(FishBase).blood = fishInfo.blood - fishNode.getComponent(FishBase).isDead = false - return fishNode.getComponent(FishBase) - } + private randomFish() { + if (this.isFishMap) return + let randomNum: number = RandomUtil.nextInt(1, 10) + // let randomNum: number = RandomUtil.nextInt(1, 1); + for (let i = 0; i < randomNum; i++) { + let fishType: number = RandomUtil.nextInt(1, 29) + // let fishType: number = RandomUtil.nextInt(1, 1); + let fish: FishBase = this.createFishByType(fishType) + fish.fishPathInfo = FishPathConfig.randomPathInfo() + this._fishPosCache.z = 0 + this._fishPosCache.x = fish.fishPathInfo.path[0].x + this._fishPosCache.y = fish.fishPathInfo.path[0].y + fish.node.setPosition(this._fishPosCache) + fish.getComponent(FishMover).bezierPList = fish.fishPathInfo.path + fish.getComponent(FishMover).startMove() + this.fishList.push(fish) + this.fishContainer.addChild(fish.node) + } + Logger.log('checkFishMoveEnd=randomFish=', this.fishList) + this.nextRandomFishTime = RandomUtil.nextInt( + this.minRandomTime, + this.maxRandomTime + ) + if (this.mapCount <= 0) { + this.mapCount = RandomUtil.nextInt(this.minMapCount, this.maxMapCount) + } + } - public killFish(fish: FishBase) { - let index: number = this.fishList.indexOf(fish) - if (index >= 0) { - // console.log("鱼挂了") - GameMusicHelper.playFishDead(fish.fishType) - fish.node.getPosition(this._fishPosCache) - let vec2 = new Vec2(this._fishPosCache.x, this._fishPosCache.y) - ScoreManager.instance.addScore(fish.fishInfo.blood, vec2) - this.fishList.splice(index, 1) - this.destroyFish(fish) - this.checkEndFishMap() - } - } + public createFishByType(fishType: number): FishBase { + let fishNode: Node + if (this.fishPool[fishType - 1] && this.fishPool[fishType - 1].size() > 0) { + fishNode = this.fishPool[fishType - 1].get() + } else { + fishNode = instantiate(this.fishPrefabList[fishType - 1]) + } + //fishNode.getComponent(Animation).play() //v3 当前帧 不能播放 + TimeHelper.exeNextFrame(fishNode, () => + fishNode.getComponent(Animation).play() + ) + let fishInfo: FishInfo = FishConfig.getFishInfoByType(fishType) + fishNode.getComponent(FishBase).fishInfo = fishInfo + fishNode.getComponent(FishBase).fishType = fishType + fishNode.getComponent(FishBase).blood = fishInfo.blood + fishNode.getComponent(FishBase).isDead = false + return fishNode.getComponent(FishBase) + } - private destroyFish(fish: FishBase) { - if (!this.fishPool[fish.fishType - 1]) { - this.fishPool[fish.fishType - 1] = new NodePool() - } - this.fishPool[fish.fishType - 1].put(fish.node) - } + public killFish(fish: FishBase) { + let index: number = this.fishList.indexOf(fish) + if (index >= 0) { + // console.log("鱼挂了") + GameMusicHelper.playFishDead(fish.fishType) + fish.node.getPosition(this._fishPosCache) + let vec2 = new Vec2(this._fishPosCache.x, this._fishPosCache.y) + ScoreManager.instance.addScore(fish.fishInfo.blood, vec2) + this.fishList.splice(index, 1) + this.destroyFish(fish) + this.checkEndFishMap() + } + } - public playFishMap() { - this.isFishMap = true - for (let i = this.fishList.length - 1; i >= 0; i--) { - let fish: FishBase = this.fishList[i] - this.destroyFish(fish) - this.fishList.splice(i, 1) - } - } + private destroyFish(fish: FishBase) { + if (!this.fishPool[fish.fishType - 1]) { + this.fishPool[fish.fishType - 1] = new NodePool() + } + this.fishPool[fish.fishType - 1].put(fish.node) + } - public startFishMap() { - // this.playFishMap(); - // this.fishList = []; + public playFishMap() { + this.isFishMap = true + for (let i = this.fishList.length - 1; i >= 0; i--) { + let fish: FishBase = this.fishList[i] + this.destroyFish(fish) + this.fishList.splice(i, 1) + } + } - let map: FishMap = FishPathConfig.randomFishMap() - let fishMapInfoList: Array = map.fishMapInfoList - Logger.log('startFishMap==', this.isFishMap, this.fishList, map) - for (let i = 0; i < fishMapInfoList.length; i++) { - let fishMapInfo: FishMapInfo = fishMapInfoList[i] - let fish: FishBase = this.createFishByType(fishMapInfo.fishType) - fish.node.angle = 0 - // fish.node.setScale(fishMapInfo.scale); - this.fishContainer.addChild(fish.node) - fish.node.setPosition(fishMapInfo.x + screen.width, fishMapInfo.y) - this.fishList.push(fish) - } - } + public startFishMap() { + // this.playFishMap(); + // this.fishList = []; - onDestroy() { - FishManager.instance = null - } + let map: FishMap = FishPathConfig.randomFishMap() + let fishMapInfoList: Array = map.fishMapInfoList + Logger.log('startFishMap==', this.isFishMap, this.fishList, map) + for (let i = 0; i < fishMapInfoList.length; i++) { + let fishMapInfo: FishMapInfo = fishMapInfoList[i] + let fish: FishBase = this.createFishByType(fishMapInfo.fishType) + fish.node.angle = 0 + // fish.node.setScale(fishMapInfo.scale); + this.fishContainer.addChild(fish.node) + fish.node.setPosition(fishMapInfo.x + screen.width, fishMapInfo.y) + this.fishList.push(fish) + } + } + + onDestroy() { + FishManager.instance = null + } } diff --git a/assets/FishSingle/script/game/manager/FishNetManager.ts b/assets/FishSingle/script/game/manager/FishNetManager.ts index 0a20479..189933e 100644 --- a/assets/FishSingle/script/game/manager/FishNetManager.ts +++ b/assets/FishSingle/script/game/manager/FishNetManager.ts @@ -1,53 +1,45 @@ -import { - _decorator, - Component, - Prefab, - NodePool, - Vec2, - instantiate, - Vec3, - Node, -} from 'cc' -const { ccclass, property } = _decorator - +import { _decorator, Component, instantiate, Node, NodePool, Prefab, Vec2, Vec3 } from 'cc' import FishNetBase from '../../../fish/script/FishNetBase' +const { ccclass, property } = _decorator + @ccclass('FishNetManager') export default class FishNetManager extends Component { - public static instance: FishNetManager = null - @property({ type: [Prefab] }) - private netPrefabList: Prefab[] = [] - private fishNetPool: Array = [] - onLoad() { - FishNetManager.instance = this - } + public static instance: FishNetManager = null + @property({ type: [Prefab] }) + private netPrefabList: Prefab[] | [] = [] + private fishNetPool: Array = [] - public addFishNet(netType: number, p: Vec2) { - let fishNet: FishNetBase = this.createFishNet(netType) - this.node.addChild(fishNet.node) - fishNet.node.setPosition(new Vec3(p.x, p.y, 0)) - fishNet.playMv() - } + onLoad() { + FishNetManager.instance = this + } - private createFishNet(netType: number) { - let fishNetNode: Node - if (this.fishNetPool[netType] && this.fishNetPool[netType].size() > 0) { - fishNetNode = this.fishNetPool[netType].get() - } else { - fishNetNode = instantiate(this.netPrefabList[netType]) - } - fishNetNode.getComponent(FishNetBase).netType = netType - return fishNetNode.getComponent(FishNetBase) - } + public addFishNet(netType: number, p: Vec2) { + let fishNet: FishNetBase = this.createFishNet(netType) + this.node.addChild(fishNet.node) + fishNet.node.setPosition(new Vec3(p.x, p.y, 0)) + fishNet.playMv() + } - public destroyFishNet(fishNet: FishNetBase) { - if (!this.fishNetPool[fishNet.netType]) { - this.fishNetPool[fishNet.netType] = new NodePool() - } - this.fishNetPool[fishNet.netType].put(fishNet.node) - } + private createFishNet(netType: number) { + let fishNetNode: Node + if (this.fishNetPool[netType] && this.fishNetPool[netType].size() > 0) { + fishNetNode = this.fishNetPool[netType].get() + } else { + fishNetNode = instantiate(this.netPrefabList[netType]) + } + fishNetNode.getComponent(FishNetBase).netType = netType + return fishNetNode.getComponent(FishNetBase) + } - onDestroy() { - FishNetManager.instance = null - } + public destroyFishNet(fishNet: FishNetBase) { + if (!this.fishNetPool[fishNet.netType]) { + this.fishNetPool[fishNet.netType] = new NodePool() + } + this.fishNetPool[fishNet.netType].put(fishNet.node) + } + + onDestroy() { + FishNetManager.instance = null + } } diff --git a/assets/FishSingle/script/game/manager/ScoreManager.ts b/assets/FishSingle/script/game/manager/ScoreManager.ts index d1a955f..848cd70 100644 --- a/assets/FishSingle/script/game/manager/ScoreManager.ts +++ b/assets/FishSingle/script/game/manager/ScoreManager.ts @@ -1,57 +1,51 @@ -import { - _decorator, - Component, - Prefab, - NodePool, - Vec2, - instantiate, - Node, - Vec3, -} from 'cc' -const { ccclass, property } = _decorator - +import { _decorator, Component, instantiate, Node, NodePool, Prefab, Vec2, Vec3 } from 'cc' import ScorePrefab from '../prefab/ScorePrefab' import FishUI from '../../../fish/script/FishUI' +const { ccclass, property } = _decorator + @ccclass('ScoreManager') export default class ScoreManager extends Component { - public static instance: ScoreManager = null - @property({ type: Prefab }) - private scrorePrefab: Prefab | null = null - private scorePool: NodePool - onLoad() { - ScoreManager.instance = this - this.scorePool = new NodePool() - } + public static instance: ScoreManager = null + @property({ type: Prefab }) + private scrorePrefab: Prefab | null = null + private scorePool: NodePool - public addScore(score: number, p: Vec2) { - let scorePrefab: ScorePrefab = this.createScore(score) - this.node.addChild(scorePrefab.node) - scorePrefab.node.setPosition(new Vec3(p.x, p.y, 0)) - scorePrefab.init(score) - scorePrefab.playMoveEffect(new Vec2(-472.398, -547.481), () => { - this.destroyScore(scorePrefab) - FishUI.instance.jf_score += score - FishUI.instance.refreshScore() - }) - } + onLoad() { + ScoreManager.instance = this + this.scorePool = new NodePool() + } - private createScore(score: number): ScorePrefab { - let scoreNode: Node - if (this.scorePool && this.scorePool.size() > 0) { - scoreNode = this.scorePool.get() - } else { - scoreNode = instantiate(this.scrorePrefab) - } - return scoreNode.getComponent(ScorePrefab) - } + public addScore(score: number, p: Vec2) { + let scorePrefab: ScorePrefab = this.createScore(score) + this.node.addChild(scorePrefab.node) + scorePrefab.node.setPosition(new Vec3(p.x, p.y, 0)) + scorePrefab.init(score) + scorePrefab.playMoveEffect(new Vec2(-472.398, -547.481), () => { + this.destroyScore(scorePrefab) + FishUI.instance.jf_score += score + FishUI.instance.refreshScore() + }) + } - private destroyScore(scorePrefab: ScorePrefab) { - this.scorePool.put(scorePrefab.node) - } + private createScore(score: number): ScorePrefab { + let scoreNode: Node + if (this.scorePool && this.scorePool.size() > 0) { + scoreNode = this.scorePool.get() + } else { + scoreNode = instantiate(this.scrorePrefab) + } + return scoreNode.getComponent(ScorePrefab) + } - onDisable() {} - onDestroy() { - ScoreManager.instance = null - } + private destroyScore(scorePrefab: ScorePrefab) { + this.scorePool.put(scorePrefab.node) + } + + onDisable() { + } + + onDestroy() { + ScoreManager.instance = null + } } diff --git a/assets/FishSingle/script/game/prefab/ResourcePrefab.ts b/assets/FishSingle/script/game/prefab/ResourcePrefab.ts index 1d41947..3593463 100644 --- a/assets/FishSingle/script/game/prefab/ResourcePrefab.ts +++ b/assets/FishSingle/script/game/prefab/ResourcePrefab.ts @@ -1,9 +1,9 @@ -import { _decorator, Component, Prefab, Node, instantiate } from 'cc' -const { ccclass, property } = _decorator - +import { _decorator, Component, instantiate, Node, Prefab } from 'cc' import PrefabLoader from '../../engine/utils/PrefabLoader' import { GameConfig } from '../config/GameConfig' +const { ccclass, property } = _decorator + @ccclass('ResourcePrefab') export default class ResourcePrefab extends Component { private static prefab: Prefab | null = null diff --git a/assets/FishSingle/script/game/prefab/ScorePrefab.ts b/assets/FishSingle/script/game/prefab/ScorePrefab.ts index e434b6d..1ee5916 100644 --- a/assets/FishSingle/script/game/prefab/ScorePrefab.ts +++ b/assets/FishSingle/script/game/prefab/ScorePrefab.ts @@ -1,4 +1,5 @@ -import { _decorator, Component, Label, Vec2, tween, Vec3, Tween } from 'cc' +import { _decorator, Component, Label, tween, Tween, Vec2, Vec3 } from 'cc' + const { ccclass, property } = _decorator @ccclass('ScorePrefab') diff --git a/assets/FishSingle/script/game/prefab/ShaderMaterialPrefab.ts b/assets/FishSingle/script/game/prefab/ShaderMaterialPrefab.ts index fa5c439..47e7e28 100644 --- a/assets/FishSingle/script/game/prefab/ShaderMaterialPrefab.ts +++ b/assets/FishSingle/script/game/prefab/ShaderMaterialPrefab.ts @@ -1,41 +1,42 @@ -import { _decorator, Component, Node, Material, instantiate, Prefab } from 'cc' -const { ccclass, property } = _decorator - +import { _decorator, Component, instantiate, Material, Node, Prefab } from 'cc' import PrefabLoader from '../../engine/utils/PrefabLoader' import { GameConfig } from '../config/GameConfig' +const { ccclass, property } = _decorator + @ccclass('ShaderMaterialPrefab') export default class ShaderMaterialPrefab extends Component { - public static instance: Node + public static instance: Node - @property({ type: Material }) - public default: Material | null = null + @property({ type: Material }) + public default: Material | null = null - @property({ type: Material }) - public grayMaterial: Material | null = null - @property({ type: Material }) - public oldPhoto: Material | null = null - @property({ type: Material }) - public glowInner: Material | null = null - @property({ type: Material }) - public mosaic: Material | null = null - @property({ type: Material }) - public roundCornerCrop: Material | null = null - @property({ type: Material }) - public flashLight: Material | null = null - @property({ type: Material }) - public flag: Material | null = null - @property({ type: Material }) - public gaussian: Material | null = null - public static preLoad(): Promise { - return new Promise((resolve, reject) => { - PrefabLoader.loadPrefab( - GameConfig.GameName + '/' + 'game/prefab/ShaderMaterialPrefab', - (loadedResource: Prefab) => { - ShaderMaterialPrefab.instance = instantiate(loadedResource) - resolve() - } - ) - }) - } + @property({ type: Material }) + public grayMaterial: Material | null = null + @property({ type: Material }) + public oldPhoto: Material | null = null + @property({ type: Material }) + public glowInner: Material | null = null + @property({ type: Material }) + public mosaic: Material | null = null + @property({ type: Material }) + public roundCornerCrop: Material | null = null + @property({ type: Material }) + public flashLight: Material | null = null + @property({ type: Material }) + public flag: Material | null = null + @property({ type: Material }) + public gaussian: Material | null = null + + public static preLoad(): Promise { + return new Promise((resolve, reject) => { + PrefabLoader.loadPrefab( + GameConfig.GameName + '/' + 'game/prefab/ShaderMaterialPrefab', + (loadedResource: Prefab) => { + ShaderMaterialPrefab.instance = instantiate(loadedResource) + resolve() + } + ) + }) + } } diff --git a/assets/FishSingle/script/game/scene/FishGameScene.ts b/assets/FishSingle/script/game/scene/FishGameScene.ts index 6640090..9200b4f 100644 --- a/assets/FishSingle/script/game/scene/FishGameScene.ts +++ b/assets/FishSingle/script/game/scene/FishGameScene.ts @@ -1,6 +1,4 @@ -import { _decorator, Sprite, Prefab, Node, instantiate, Vec3, Tween } from 'cc' -const { ccclass, property } = _decorator - +import { _decorator, instantiate, Node, Prefab, Sprite, Tween, Vec3 } from 'cc' import SceneBase from './SceneBase' import TextureMgr from '../../engine/uicomponent/TextureMgr' import RandomUtil from '../../engine/utils/RandomUtil' @@ -11,62 +9,65 @@ import { Logger } from '../../engine/utils/Logger' import FishWiki from '../../../fish/script/FishWiki' import GameMusicHelper from '../utils/GameMusicHelper' +const { ccclass, property } = _decorator + @ccclass('FishGameScene') export default class FishGameScene extends SceneBase { - @property(Sprite) - private bg: Sprite | null = null - @property({ type: [Prefab] }) - private fishPrefabList: Array = [] - private showNode: Node | null = null - onLoadMe() { - GameMusicHelper.playBg() - FishPathConfig.init() - this.initBg() - // this.testPathPlay() - } + @property(Sprite) + private bg: Sprite | null = null + @property({ type: [Prefab] }) + private fishPrefabList: Array | null = [] + private showNode: Node | null = null - private initBg() { - let textureMgr: TextureMgr = this.bg.getComponent(TextureMgr) - this.bg.spriteFrame = - textureMgr.Spriteset[ - RandomUtil.nextInt(0, textureMgr.Spriteset.length - 1) - ] - } + onLoadMe() { + GameMusicHelper.playBg() + FishPathConfig.init() + this.initBg() + // this.testPathPlay() + } - private initShowNode() { - if (this.showNode) { - this.showNode.destroy() - this.showNode = null - } - let fishType: number = 29 - if (fishType < 1 || fishType > 29) { - return - } - this.showNode = instantiate(this.fishPrefabList[fishType - 1]) - this.showNode.getComponent(FishMover).speed = 2 - this.showNode.getComponent(FishMover).node.setScale(new Vec3(2, 2, 1)) - this.node.addChild(this.showNode) - } + private initBg() { + let textureMgr: TextureMgr = this.bg.getComponent(TextureMgr) + this.bg.spriteFrame = + textureMgr.Spriteset[ + RandomUtil.nextInt(0, textureMgr.Spriteset.length - 1) + ] + } - private testPathPlay() { - this.initShowNode() - let pathInfo: FishPathInfo = FishPathConfig.getPathInfo(3) - Logger.log('testPathPlay=pathInfo=', pathInfo) - let params = pathInfo.path - let param0 = params[0] - Logger.log('testPathPlay=11=', param0) - this.showNode.setPosition(new Vec3(param0.x, param0.y, 0)) - this.showNode.getComponent(FishMover).bezierPList = params - this.showNode.getComponent(FishMover).startMove() - } + private initShowNode() { + if (this.showNode) { + this.showNode.destroy() + this.showNode = null + } + let fishType: number = 29 + if (fishType < 1 || fishType > 29) { + return + } + this.showNode = instantiate(this.fishPrefabList[fishType - 1]) + this.showNode.getComponent(FishMover).speed = 2 + this.showNode.getComponent(FishMover).node.setScale(new Vec3(2, 2, 1)) + this.node.addChild(this.showNode) + } - private onClickWiki() { - FishWiki.show() - } + private testPathPlay() { + this.initShowNode() + let pathInfo: FishPathInfo = FishPathConfig.getPathInfo(3) + Logger.log('testPathPlay=pathInfo=', pathInfo) + let params = pathInfo.path + let param0 = params[0] + Logger.log('testPathPlay=11=', param0) + this.showNode.setPosition(new Vec3(param0.x, param0.y, 0)) + this.showNode.getComponent(FishMover).bezierPList = params + this.showNode.getComponent(FishMover).startMove() + } - onDestroyMe() { - this.unscheduleAllCallbacks() - //this.node.stopAllActions(); - Tween.stopAllByTarget(this.node) - } + private onClickWiki() { + FishWiki.show() + } + + onDestroyMe() { + this.unscheduleAllCallbacks() + //this.node.stopAllActions(); + Tween.stopAllByTarget(this.node) + } } diff --git a/assets/FishSingle/script/game/scene/LoadingScene.ts b/assets/FishSingle/script/game/scene/LoadingScene.ts index e8d5d34..cab76b9 100644 --- a/assets/FishSingle/script/game/scene/LoadingScene.ts +++ b/assets/FishSingle/script/game/scene/LoadingScene.ts @@ -1,13 +1,4 @@ -import { - _decorator, - Node, - sys, - profiler, - DynamicAtlasManager, - PhysicsSystem2D, -} from 'cc' -const { ccclass, property } = _decorator - +import { _decorator, DynamicAtlasManager, Node, PhysicsSystem2D, profiler, sys } from 'cc' import MusicConfig from '../../engine/config/MusicConfig' import CommonTips from '../../engine/uicomponent/CommonTips' import Progress from '../../engine/uicomponent/Progress' @@ -19,138 +10,141 @@ import ResourcePreload from '../utils/ResourcePreload' import SceneBase from './SceneBase' import SceneManager from './SceneManager' +const { ccclass, property } = _decorator + @ccclass('LoadingScene') export default class LoadingScene extends SceneBase { - public static scriptName: string = 'LoadingScene' - @property({ type: Node }) - private progressNode: Node | null = null - onLoadMe() { - this.baseInit() - EventManager.instance.addListener( - HotUpdate.Event_On_NeedUpdate, - this.onNeedUpdate, - this - ) - EventManager.instance.addListener( - HotUpdate.Event_On_Progress, - this.onUpdateProgress, - this - ) - EventManager.instance.addListener( - HotUpdate.Event_On_Fail_Update, - this.onUpdateFail, - this - ) - EventManager.instance.addListener( - HotUpdate.Event_Finish_Update, - this.onUpdateFinish, - this - ) - EventManager.instance.addListener( - HotUpdate.Event_On_ALREADY_UP_TO_DATE, - this.onUpdateFinish, - this - ) - if (sys.isNative && VersionManager.instance.isOpenHotUpdate) { - this.checkUpdate() - } else { - this.preLoadRes() - } - } + public static scriptName: string = 'LoadingScene' + @property({ type: Node }) + private progressNode: Node | null = null - private baseInit() { - profiler.hideStats() //showStats - //let collisionManager:cc.CollisionManager = director.getCollisionManager(); - PhysicsSystem2D.instance.enable = true + async onLoadMe() { + this.baseInit() + EventManager.instance.addListener( + HotUpdate.Event_On_NeedUpdate, + this.onNeedUpdate, + this + ) + EventManager.instance.addListener( + HotUpdate.Event_On_Progress, + this.onUpdateProgress, + this + ) + EventManager.instance.addListener( + HotUpdate.Event_On_Fail_Update, + this.onUpdateFail, + this + ) + EventManager.instance.addListener( + HotUpdate.Event_Finish_Update, + this.onUpdateFinish, + this + ) + EventManager.instance.addListener( + HotUpdate.Event_On_ALREADY_UP_TO_DATE, + this.onUpdateFinish, + this + ) + if (sys.isNative && VersionManager.instance.isOpenHotUpdate) { + this.checkUpdate() + } else { + await this.preLoadRes() + } + } - // PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb | - // EPhysics2DDrawFlags.Pair | - // EPhysics2DDrawFlags.CenterOfMass | - // EPhysics2DDrawFlags.Joint | - // EPhysics2DDrawFlags.Shape; + private baseInit() { + profiler.hideStats() //showStats + //let collisionManager:cc.CollisionManager = director.getCollisionManager(); + PhysicsSystem2D.instance.enable = true - //if(collisionManager){ - //collisionManager.enabled = true; - // collisionManager.enabledDebugDraw = true; - // collisionManager.enabledDrawBoundingBox = true; - //} + // PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb | + // EPhysics2DDrawFlags.Pair | + // EPhysics2DDrawFlags.CenterOfMass | + // EPhysics2DDrawFlags.Joint | + // EPhysics2DDrawFlags.Shape; - if (DynamicAtlasManager.instance) { - DynamicAtlasManager.instance.enabled = false - } - MusicConfig.init() - // cc.director.getCollisionManager().enabled=true;//这是一个全局属性,开启后就代表碰撞检测组件可以进行检测了 - // cc.director.getCollisionManager().enabledDebugDraw = true; //绘制碰撞区域 - } + //if(collisionManager){ + //collisionManager.enabled = true; + // collisionManager.enabledDebugDraw = true; + // collisionManager.enabledDrawBoundingBox = true; + //} - private checkUpdate() { - Logger.log(this, 'checkUpdate====') - VersionManager.instance.checkUpdate(0) - } + if (DynamicAtlasManager.instance) { + DynamicAtlasManager.instance.enabled = false + } + MusicConfig.init() + // cc.director.getCollisionManager().enabled=true;//这是一个全局属性,开启后就代表碰撞检测组件可以进行检测了 + // cc.director.getCollisionManager().enabledDebugDraw = true; //绘制碰撞区域 + } - private onNeedUpdate(event: HaoEvent, key: string) { - Logger.log(this, 'onNeedUpdate=====', key, VersionManager.Config_Key) - if (key == VersionManager.Config_Key[0]) { - VersionManager.instance.startUpdate(0) - } - } + private checkUpdate() { + Logger.log(this, 'checkUpdate====') + VersionManager.instance.checkUpdate(0) + } - private onUpdateProgress(event, loadedFiles, totalFiles, key) { - if (key == VersionManager.Config_Key[0]) { - let msg: string = - Math.min(100, (loadedFiles / totalFiles) * 100).toFixed(2) + '%' - this.progressNode - .getComponent(Progress) - .updateProgress(loadedFiles, totalFiles, msg) - } - } + private onNeedUpdate(event: HaoEvent, key: string) { + Logger.log(this, 'onNeedUpdate=====', key, VersionManager.Config_Key) + if (key == VersionManager.Config_Key[0]) { + VersionManager.instance.startUpdate(0) + } + } - private onUpdateFail(event, key: string) { - if (key == VersionManager.Config_Key[0]) { - Logger.warn(this, '热更新失败========') - CommonTips.showMsg('热更新失败') - ResourcePreload.instance.restartGame() - } - } + private onUpdateProgress(event: Function, loadedFiles: number, totalFiles: number, key: string) { + if (key == VersionManager.Config_Key[0]) { + let msg: string = + Math.min(100, (loadedFiles / totalFiles) * 100).toFixed(2) + '%' + this.progressNode + .getComponent(Progress) + .updateProgress(loadedFiles, totalFiles, msg) + } + } - private onUpdateFinish(event, key: string, needRestart: boolean) { - Logger.log(this, 'onUpdateFinish========') - if (key == VersionManager.Config_Key[0] && !needRestart) { - this.preLoadRes() - } - } + private onUpdateFail(event, key: string) { + if (key == VersionManager.Config_Key[0]) { + Logger.warn(this, '热更新失败========') + CommonTips.showMsg('热更新失败') + ResourcePreload.instance.restartGame() + } + } - private async preLoadRes() { - ResourcePreload.instance.preLoad(() => { - this.startGame() - }, this.progressNode.getComponent(Progress)) - } + private onUpdateFinish(event, key: string, needRestart: boolean) { + Logger.log(this, 'onUpdateFinish========') + if (key == VersionManager.Config_Key[0] && !needRestart) { + this.preLoadRes() + } + } - private startGame() { - Logger.info(this, 'startGame') - SceneManager.instance.sceneSwitch('FishGameScene', true) - } + private async preLoadRes() { + ResourcePreload.instance.preLoad(() => { + this.startGame() + }, this.progressNode.getComponent(Progress)) + } - onDestroyMe() { - EventManager.instance.removeListener( - HotUpdate.Event_On_NeedUpdate, - this.onNeedUpdate - ) - EventManager.instance.removeListener( - HotUpdate.Event_On_Progress, - this.onUpdateProgress - ) - EventManager.instance.removeListener( - HotUpdate.Event_On_Fail_Update, - this.onUpdateFail - ) - EventManager.instance.removeListener( - HotUpdate.Event_Finish_Update, - this.onUpdateFinish - ) - EventManager.instance.removeListener( - HotUpdate.Event_On_ALREADY_UP_TO_DATE, - this.onUpdateFinish - ) - } + private startGame() { + Logger.info(this, 'startGame') + SceneManager.instance.sceneSwitch('FishGameScene', true) + } + + onDestroyMe() { + EventManager.instance.removeListener( + HotUpdate.Event_On_NeedUpdate, + this.onNeedUpdate + ) + EventManager.instance.removeListener( + HotUpdate.Event_On_Progress, + this.onUpdateProgress + ) + EventManager.instance.removeListener( + HotUpdate.Event_On_Fail_Update, + this.onUpdateFail + ) + EventManager.instance.removeListener( + HotUpdate.Event_Finish_Update, + this.onUpdateFinish + ) + EventManager.instance.removeListener( + HotUpdate.Event_On_ALREADY_UP_TO_DATE, + this.onUpdateFinish + ) + } } diff --git a/assets/FishSingle/script/game/scene/SceneBase.ts b/assets/FishSingle/script/game/scene/SceneBase.ts index d241dbf..bf142b6 100644 --- a/assets/FishSingle/script/game/scene/SceneBase.ts +++ b/assets/FishSingle/script/game/scene/SceneBase.ts @@ -1,25 +1,31 @@ import { _decorator, Component } from 'cc' -const { ccclass, property } = _decorator - import AdapterHelper from '../../engine/utils/AdapterHelper' -import PrefabLoader from '../../engine/utils/PrefabLoader' -import { Logger } from '../../engine/utils/Logger' -import ResourcePrefab from '../prefab/ResourcePrefab' + +const { ccclass, property } = _decorator @ccclass('SceneBase') export default class SceneBase extends Component { - public static scriptName: string = 'SceneBase' - onLoad() { - AdapterHelper.fixApdater() - this.onLoadMe() - } - onLoadMe() {} - start() { - this.onStartMe() - } - onStartMe() {} - onDestroy() { - this.onDestroyMe() - } - onDestroyMe() {} + public static scriptName: string = 'SceneBase' + + onLoad() { + AdapterHelper.fixApdater() + this.onLoadMe() + } + + onLoadMe() { + } + + start() { + this.onStartMe() + } + + onStartMe() { + } + + onDestroy() { + this.onDestroyMe() + } + + onDestroyMe() { + } } diff --git a/assets/FishSingle/script/game/scene/SceneManager.ts b/assets/FishSingle/script/game/scene/SceneManager.ts index 50c2e8c..a540e58 100644 --- a/assets/FishSingle/script/game/scene/SceneManager.ts +++ b/assets/FishSingle/script/game/scene/SceneManager.ts @@ -1,4 +1,4 @@ -import { director, SceneAsset, sys, _decorator } from 'cc' +import { director, SceneAsset, sys } from 'cc' import { Logger } from '../../engine/utils/Logger' import LoadingScenePrefab from '../../engine/uicomponent/LoadingScenePrefab' import CommonTips from '../../engine/uicomponent/CommonTips' @@ -6,67 +6,67 @@ import EventManager from '../../engine/utils/EventManager' import CommonEvent from '../../engine/config/CommonEvent' export default class SceneManager { - public static instance: SceneManager = new SceneManager() + public static instance: SceneManager = new SceneManager() - private loadingSceneName: string + private loadingSceneName: string - public currentSceneName: string + public currentSceneName: string - public initFullScreenPrefab(isShow: boolean = false) { - if (sys.isBrowser && !sys.isMobile) { - if (isShow) { - // FullscreenPrefab.show(); - } else { - // FullscreenPrefab.close(); - } - } - } + public initFullScreenPrefab(isShow: boolean = false) { + if (sys.isBrowser && !sys.isMobile) { + if (isShow) { + // FullscreenPrefab.show(); + } else { + // FullscreenPrefab.close(); + } + } + } - public sceneSwitch(name: string, showProgress: boolean = false) { - if (this.loadingSceneName == name) return - Logger.log(this, 'sceneSwitch==', name) - if (sys.isBrowser) { - // showProgress = true; - } - this.initFullScreenPrefab(false) - this.loadingSceneName = name - if (showProgress) { - LoadingScenePrefab.show() - director.preloadScene( - name, - (completedCount: number, totalCount: number, item: any) => { - LoadingScenePrefab.updateLoading(completedCount, totalCount) - }, - (error: Error, asset: SceneAsset) => { - if (error) { - Logger.warn(this, 'preloadScene=error', error.message) - CommonTips.showMsg('加载场景失败') - } else { - //director.getScene().destroy();//director.getScene().cleanup(); - director.loadScene(name, this.loadSceneOK.bind(this)) - } - } - ) - } else { - //director.getScene().destroy();//director.getScene().cleanup(); - director.loadScene(name, this.loadSceneOK.bind(this)) - } - } + public async sceneSwitch(name: string, showProgress: boolean = false) { + if (this.loadingSceneName == name) return + Logger.log(this, 'sceneSwitch==', name) + if (sys.isBrowser) { + // showProgress = true; + } + this.initFullScreenPrefab(false) + this.loadingSceneName = name + if (showProgress) { + await LoadingScenePrefab.show() + director.preloadScene( + name, + (completedCount: number, totalCount: number, item: any) => { + LoadingScenePrefab.updateLoading(completedCount, totalCount) + }, + (error: Error, asset: SceneAsset) => { + if (error) { + Logger.warn(this, 'preloadScene=error', error.message) + CommonTips.showMsg('加载场景失败') + } else { + //director.getScene().destroy();//director.getScene().cleanup(); + director.loadScene(name, this.loadSceneOK.bind(this)) + } + } + ) + } else { + //director.getScene().destroy();//director.getScene().cleanup(); + director.loadScene(name, this.loadSceneOK.bind(this)) + } + } - private loadSceneOK() { - LoadingScenePrefab.close() - this.initFullScreenPrefab(true) - this.currentSceneName = this.loadingSceneName - this.loadingSceneName = '' - Logger.log(this, 'scene load ok=', this.currentSceneName) - EventManager.instance.dispatchEvent(CommonEvent.Event_Scene_Switch) - } + private loadSceneOK() { + LoadingScenePrefab.close() + this.initFullScreenPrefab(true) + this.currentSceneName = this.loadingSceneName + this.loadingSceneName = '' + Logger.log(this, 'scene load ok=', this.currentSceneName) + EventManager.instance.dispatchEvent(CommonEvent.Event_Scene_Switch) + } - public preloadScene( - sceneName: string, - onProgressCallback: any = null, - onLoadedCallback: any = null - ) { - director.preloadScene(sceneName, onProgressCallback, onLoadedCallback) - } + public preloadScene( + sceneName: string, + onProgressCallback: any = null, + onLoadedCallback: any = null + ) { + director.preloadScene(sceneName, onProgressCallback, onLoadedCallback) + } } diff --git a/assets/FishSingle/script/game/scene/StartScene.ts b/assets/FishSingle/script/game/scene/StartScene.ts index a0e2bf5..e281979 100644 --- a/assets/FishSingle/script/game/scene/StartScene.ts +++ b/assets/FishSingle/script/game/scene/StartScene.ts @@ -1,15 +1,18 @@ import { _decorator } from 'cc' -const { ccclass, property } = _decorator - -import EventManager, { HaoEvent } from '../../engine/utils/EventManager' import SceneBase from './SceneBase' -import SceneManager from './SceneManager' + +const { ccclass, property } = _decorator @ccclass('StartScene') export default class StartScene extends SceneBase { - public static scriptName: string = 'StartScene' - onLoadMe() {} - update() {} + public static scriptName: string = 'StartScene' - onDestroyMe() {} + onLoadMe() { + } + + update() { + } + + onDestroyMe() { + } } diff --git a/assets/FishSingle/script/game/uicomponent/Astar.ts b/assets/FishSingle/script/game/uicomponent/Astar.ts index 20f36d0..2509cbb 100644 --- a/assets/FishSingle/script/game/uicomponent/Astar.ts +++ b/assets/FishSingle/script/game/uicomponent/Astar.ts @@ -1,196 +1,200 @@ import { _decorator, Component, Vec2 } from 'cc' + const { ccclass, property } = _decorator -import { Logger } from '../../engine/utils/Logger' export enum AstarGridType { - Hider = 0, //不能走 - Normal = 1, //能走 - End = 2, //终点 + Hider = 0, //不能走 + Normal = 1, //能走 + End = 2, //终点 } @ccclass('Astar') export class AstarGrid { - public x: number = 0 - public y: number = 0 - public f: number = 0 - public g: number = 0 - public h: number = 0 - public type: number = 0 - public parent: AstarGrid = null + public x: number = 0 + public y: number = 0 + public f: number = 0 + public g: number = 0 + public h: number = 0 + public type: number = 0 + public parent: AstarGrid = null } export class Astar extends Component { - public mapW: number = 24 // 横向格子数量 - public mapH: number = 13 // 纵向格子数量 - public is8dir: boolean = false // 是否8方向寻路 //4方向:代表只能走上下左右 8方向:代表可以走上下左右,左上,右上,左下,右下 - private openList: Array = [] - private closeList: Array = [] - private path: Array = [] - private gridsList: Array> = [] - onLoad() {} + public mapW: number = 24 // 横向格子数量 + public mapH: number = 13 // 纵向格子数量 + public is8dir: boolean = false // 是否8方向寻路 //4方向:代表只能走上下左右 8方向:代表可以走上下左右,左上,右上,左下,右下 + private openList: Array = [] + private closeList: Array = [] + private path: Array = [] + private gridsList: Array> = [] - /** - * @param mapW 宽格子数 - * @param mapH 高格子数 - * @param is8dir 是8方向(上,下,左,右,左上,右上,左下,右下)寻路还是4方向(上,下,左,右) - */ - public init(mapW: number, mapH: number, is8dir: boolean = false) { - this.mapW = mapW - this.mapH = mapH - this.is8dir = is8dir - this.initMap() - } + onLoad() { + } - /** - * 初始化map的格子 - */ - private initMap() { - this.openList = [] - this.closeList = [] - this.path = [] - // 初始化格子二维数组 - this.gridsList = new Array(this.mapW + 1) - for (let col = 0; col < this.gridsList.length; col++) { - this.gridsList[col] = new Array(this.mapH + 1) - } - for (let col = 0; col <= this.mapW; col++) { - for (let row = 0; row <= this.mapH; row++) { - this.addGrid(col, row, AstarGridType.Normal) - } - } - } + /** + * @param mapW 宽格子数 + * @param mapH 高格子数 + * @param is8dir 是8方向(上,下,左,右,左上,右上,左下,右下)寻路还是4方向(上,下,左,右) + */ + public init(mapW: number, mapH: number, is8dir: boolean = false) { + this.mapW = mapW + this.mapH = mapH + this.is8dir = is8dir + this.initMap() + } - /** - * 创建一个格子到地图 - * @param x - * @param y - * @param type - */ - private addGrid(x: number, y: number, type: number = AstarGridType.Hider) { - let grid = new AstarGrid() - grid.x = x - grid.y = y - grid.type = type - this.gridsList[x][y] = grid - } + /** + * 初始化map的格子 + */ + private initMap() { + this.openList = [] + this.closeList = [] + this.path = [] + // 初始化格子二维数组 + this.gridsList = new Array(this.mapW + 1) + for (let col = 0; col < this.gridsList.length; col++) { + this.gridsList[col] = new Array(this.mapH + 1) + } + for (let col = 0; col <= this.mapW; col++) { + for (let row = 0; row <= this.mapH; row++) { + this.addGrid(col, row, AstarGridType.Normal) + } + } + } - /** - * 设置格子类型 - * @param x - * @param y - * @param type - */ - public setGridType(x: number, y: number, type: number) { - let curGrid: AstarGrid = this.gridsList[x][y] - curGrid.type = type - } + /** + * 创建一个格子到地图 + * @param x + * @param y + * @param type + */ + private addGrid(x: number, y: number, type: number = AstarGridType.Hider) { + let grid = new AstarGrid() + grid.x = x + grid.y = y + grid.type = type + this.gridsList[x][y] = grid + } - /** - * 开始搜索路径 - * @param startPos - * @param endPos - */ - public findPath(startPos: Vec2, endPos: Vec2, callback: Function = null) { - let startGrid = this.gridsList[startPos.x][startPos.y] - this.openList.push(startGrid) - let curGrid: AstarGrid = this.openList[0] - while (this.openList.length > 0 && curGrid.type != AstarGridType.End) { - // 每次都取出f值最小的节点进行查找 - curGrid = this.openList[0] - if (curGrid.type == AstarGridType.End) { - // Logger.log(this,"find path success."); - this.generatePath(curGrid) - if (callback) { - callback(this.path) - } - return - } + /** + * 设置格子类型 + * @param x + * @param y + * @param type + */ + public setGridType(x: number, y: number, type: number) { + let curGrid: AstarGrid = this.gridsList[x][y] + curGrid.type = type + } - for (let i: number = -1; i <= 1; i++) { - for (let j: number = -1; j <= 1; j++) { - if (i != 0 || j != 0) { - let col = curGrid.x + i - let row = curGrid.y + j - if ( - col >= 0 && - row >= 0 && - col <= this.mapW && - row <= this.mapH && - this.gridsList[col][row].type != AstarGridType.Hider && - this.closeList.indexOf(this.gridsList[col][row]) < 0 - ) { - if (this.is8dir) { - // 8方向 斜向走动时要考虑相邻的是不是障碍物 - if ( - this.gridsList[col - i][row].type == AstarGridType.Hider || - this.gridsList[col][row - j].type == AstarGridType.Hider - ) { - continue - } - } else { - // 四方形行走 - if (Math.abs(i) == Math.abs(j)) { - continue - } - } - // 计算g值 - let g = - curGrid.g + - Math.floor(Math.sqrt(Math.pow(i * 10, 2)) + Math.pow(j * 10, 2)) - if ( - this.gridsList[col][row].g == 0 || - this.gridsList[col][row].g > g - ) { - this.gridsList[col][row].g = g - // 更新父节点 - this.gridsList[col][row].parent = curGrid - } - // 计算h值 manhattan估算法 - this.gridsList[col][row].h = - Math.abs(endPos.x - col) + Math.abs(endPos.y - row) - // 更新f值 - this.gridsList[col][row].f = - this.gridsList[col][row].g + this.gridsList[col][row].h - // 如果不在开放列表里则添加到开放列表里 - if (this.openList.indexOf(this.gridsList[col][row]) < 0) { - this.openList.push(this.gridsList[col][row]) - } - // // 重新按照f值排序(升序排列) - } - } - } - } - // 遍历完四周节点后把当前节点加入关闭列表 - this.closeList.push(curGrid) - // 从开放列表把当前节点移除 - this.openList.splice(this.openList.indexOf(curGrid), 1) - if (this.openList.length <= 0) { - // Logger.log(this,"find path failed."); - this.path = [] - if (callback) { - callback(this.path) - } - break - } - // 重新按照f值排序(升序排列) - this.openList.sort((x, y) => { - return x.f - y.f - }) - } - } + /** + * 开始搜索路径 + * @param startPos + * @param endPos + * @param callback + */ + public findPath(startPos: Vec2, endPos: Vec2, callback: Function = null) { + let startGrid = this.gridsList[startPos.x][startPos.y] + this.openList.push(startGrid) + let curGrid: AstarGrid = this.openList[0] + while (this.openList.length > 0 && curGrid.type != AstarGridType.End) { + // 每次都取出f值最小的节点进行查找 + curGrid = this.openList[0] + if (curGrid.type == AstarGridType.End) { + // Logger.log(this,"find path success."); + this.generatePath(curGrid) + if (callback) { + callback(this.path) + } + return + } - /** - * 生成路径 - * @param grid - */ - private generatePath(grid: AstarGrid) { - this.path.push(grid) - while (grid.parent) { - grid = grid.parent - this.path.push(grid) - } - return this.path - } + for (let i: number = -1; i <= 1; i++) { + for (let j: number = -1; j <= 1; j++) { + if (i != 0 || j != 0) { + let col = curGrid.x + i + let row = curGrid.y + j + if ( + col >= 0 && + row >= 0 && + col <= this.mapW && + row <= this.mapH && + this.gridsList[col][row].type != AstarGridType.Hider && + this.closeList.indexOf(this.gridsList[col][row]) < 0 + ) { + if (this.is8dir) { + // 8方向 斜向走动时要考虑相邻的是不是障碍物 + if ( + this.gridsList[col - i][row].type == AstarGridType.Hider || + this.gridsList[col][row - j].type == AstarGridType.Hider + ) { + continue + } + } else { + // 四方形行走 + if (Math.abs(i) == Math.abs(j)) { + continue + } + } + // 计算g值 + let g = + curGrid.g + + Math.floor(Math.sqrt(Math.pow(i * 10, 2)) + Math.pow(j * 10, 2)) + if ( + this.gridsList[col][row].g == 0 || + this.gridsList[col][row].g > g + ) { + this.gridsList[col][row].g = g + // 更新父节点 + this.gridsList[col][row].parent = curGrid + } + // 计算h值 manhattan估算法 + this.gridsList[col][row].h = + Math.abs(endPos.x - col) + Math.abs(endPos.y - row) + // 更新f值 + this.gridsList[col][row].f = + this.gridsList[col][row].g + this.gridsList[col][row].h + // 如果不在开放列表里则添加到开放列表里 + if (this.openList.indexOf(this.gridsList[col][row]) < 0) { + this.openList.push(this.gridsList[col][row]) + } + // // 重新按照f值排序(升序排列) + } + } + } + } + // 遍历完四周节点后把当前节点加入关闭列表 + this.closeList.push(curGrid) + // 从开放列表把当前节点移除 + this.openList.splice(this.openList.indexOf(curGrid), 1) + if (this.openList.length <= 0) { + // Logger.log(this,"find path failed."); + this.path = [] + if (callback) { + callback(this.path) + } + break + } + // 重新按照f值排序(升序排列) + this.openList.sort((x, y) => { + return x.f - y.f + }) + } + } - onDestroy() {} + /** + * 生成路径 + * @param grid + */ + private generatePath(grid: AstarGrid) { + this.path.push(grid) + while (grid.parent) { + grid = grid.parent + this.path.push(grid) + } + return this.path + } + + onDestroy() { + } } diff --git a/assets/FishSingle/script/game/utils/GameMusicHelper.ts b/assets/FishSingle/script/game/utils/GameMusicHelper.ts index e4cc007..071d032 100644 --- a/assets/FishSingle/script/game/utils/GameMusicHelper.ts +++ b/assets/FishSingle/script/game/utils/GameMusicHelper.ts @@ -1,19 +1,18 @@ -import { _decorator } from 'cc' import SoundPrefab from '../../engine/uicomponent/SoundPrefab' import MusicPrefab from '../../engine/uicomponent/MusicPrefab' import RandomUtil from '../../engine/utils/RandomUtil' export default class GameMusicHelper { - public static playBg() { - let randomIndex: number = RandomUtil.nextInt(1, 3) - MusicPrefab.play('background_' + randomIndex) - } + public static playBg() { + let randomIndex: number = RandomUtil.nextInt(1, 3) + MusicPrefab.play('background_' + randomIndex) + } - public static playFishDead(fishType: number) { - SoundPrefab.play('deadfish_' + fishType) - } + public static playFishDead(fishType: number) { + SoundPrefab.play('deadfish_' + fishType) + } - public static playFire() { - SoundPrefab.play('fire') - } + public static playFire() { + SoundPrefab.play('fire') + } } diff --git a/assets/FishSingle/script/game/utils/ResourcePreload.ts b/assets/FishSingle/script/game/utils/ResourcePreload.ts index 80a1c02..e1a716a 100644 --- a/assets/FishSingle/script/game/utils/ResourcePreload.ts +++ b/assets/FishSingle/script/game/utils/ResourcePreload.ts @@ -1,64 +1,64 @@ -import { error, game, _decorator } from 'cc' +import { error, game } from 'cc' import DarkLayer from '../../engine/uicomponent/DarkLayer' import LoadingPrefab from '../../engine/uicomponent/LoadingPrefab' import LoadingScenePrefab from '../../engine/uicomponent/LoadingScenePrefab' import MusicPrefab from '../../engine/uicomponent/MusicPrefab' import Progress from '../../engine/uicomponent/Progress' import SoundPrefab from '../../engine/uicomponent/SoundPrefab' -import { Logger } from '../../engine/utils/Logger' import ResourcePrefab from '../prefab/ResourcePrefab' import ShaderMaterialPrefab from '../prefab/ShaderMaterialPrefab' export default class ResourcePreload { - public static instance: ResourcePreload = new ResourcePreload() - private isPreloaded: boolean = false - private totalNum: number = 6 - private nowIndex: number = 0 - private progress: Progress - public async preLoad(callback: Function, progress: Progress) { - if (this.isPreloaded) { - callback() - return - } - this.isPreloaded = true - this.progress = progress - if (this.progress) { - progress.updateProgress(this.nowIndex, this.totalNum) - } - await LoadingPrefab.preLoad() //1 - this.finishOneItemLoad() - await DarkLayer.preLoad() //2 - this.finishOneItemLoad() - await MusicPrefab.preLoad() //3 - this.finishOneItemLoad() - await SoundPrefab.preLoad() //4 - this.finishOneItemLoad() - await ResourcePrefab.preLoad() //5 - this.finishOneItemLoad() - await ShaderMaterialPrefab.preLoad() //6 - this.finishOneItemLoad() // - callback() - } + public static instance: ResourcePreload = new ResourcePreload() + private isPreloaded: boolean = false + private totalNum: number = 6 + private nowIndex: number = 0 + private progress: Progress - private finishOneItemLoad() { - this.nowIndex++ - if (this.progress) { - this.progress.updateProgress(this.nowIndex, this.totalNum) - } - } + public async preLoad(callback: Function, progress: Progress) { + if (this.isPreloaded) { + callback() + return + } + this.isPreloaded = true + this.progress = progress + if (this.progress) { + progress.updateProgress(this.nowIndex, this.totalNum) + } + await LoadingPrefab.preLoad() //1 + this.finishOneItemLoad() + await DarkLayer.preLoad() //2 + this.finishOneItemLoad() + await MusicPrefab.preLoad() //3 + this.finishOneItemLoad() + await SoundPrefab.preLoad() //4 + this.finishOneItemLoad() + await ResourcePrefab.preLoad() //5 + this.finishOneItemLoad() + await ShaderMaterialPrefab.preLoad() //6 + this.finishOneItemLoad() // + callback() + } - public restartGame() { - this.isPreloaded = false - // GameSocket.getInstance().closeSocket(false); - LoadingScenePrefab.clear() - LoadingPrefab.clear() - error('需要获取游戏里所有的AudioSource停止音乐') - //audioEngine.stopAll(); + private finishOneItemLoad() { + this.nowIndex++ + if (this.progress) { + this.progress.updateProgress(this.nowIndex, this.totalNum) + } + } - // VersionManager.instance.releaseAll(); - MusicPrefab.destory() - SoundPrefab.destory() - ResourcePrefab.clear() - game.restart() - } + public restartGame() { + this.isPreloaded = false + // GameSocket.getInstance().closeSocket(false); + LoadingScenePrefab.clear() + LoadingPrefab.clear() + error('需要获取游戏里所有的AudioSource停止音乐') + //audioEngine.stopAll(); + + // VersionManager.instance.releaseAll(); + MusicPrefab.destory() + SoundPrefab.destory() + ResourcePrefab.clear() + game.restart() + } } diff --git a/assets/FishSingle/script/game/utils/TimeHelper.ts b/assets/FishSingle/script/game/utils/TimeHelper.ts index 4c0baca..b1f0453 100644 --- a/assets/FishSingle/script/game/utils/TimeHelper.ts +++ b/assets/FishSingle/script/game/utils/TimeHelper.ts @@ -1,7 +1,7 @@ -import { tween, Node } from 'cc' +import { Node, tween } from 'cc' export default class TimeHelper { - public static exeNextFrame(node: Node, callback: Function) { - tween(node).delay(0.02).call(callback).start() - } + public static exeNextFrame(node: Node, callback: Function) { + tween(node).delay(0.02).call(callback).start() + } } diff --git a/assets/FishSingle/script/game/utils/UIRoot.ts b/assets/FishSingle/script/game/utils/UIRoot.ts index 3920a22..782bb00 100644 --- a/assets/FishSingle/script/game/utils/UIRoot.ts +++ b/assets/FishSingle/script/game/utils/UIRoot.ts @@ -1,9 +1,10 @@ -import { _decorator, Component, Node } from 'cc' +import { _decorator, Component } from 'cc' + const { ccclass, property } = _decorator @ccclass('UIRoot') export class UIRoot extends Component { - public static Instance + public static Instance: UIRoot onLoad() { UIRoot.Instance = this } diff --git a/package.json b/package.json index cc432fb..f034d5b 100644 --- a/package.json +++ b/package.json @@ -6,5 +6,19 @@ "version": "3.8.2" }, "_sourceId": "f769f6bf-2fe4-41a7-b7ad-f38f57e2d1b9", - "_storeId": "2898572b8dca79ebffc4f4584f234c2c" + "_storeId": "2898572b8dca79ebffc4f4584f234c2c", + "devDependencies": { + "@eslint/eslintrc": "^3.0.2", + "@eslint/js": "^9.0.0", + "@typescript-eslint/eslint-plugin": "^6.4.0", + "acorn": "^8.11.3", + "eslint": "^9.0.0", + "eslint-config-standard-with-typescript": "^43.0.1", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-n": "^16.6.2", + "eslint-plugin-promise": "^6.1.1", + "globals": "^15.0.0", + "prettier": "^3.2.5", + "typescript": "^5.4.5" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2b9f188..038bd50 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3,3 +3,1835 @@ lockfileVersion: '6.0' settings: autoInstallPeers: true excludeLinksFromLockfile: false + +devDependencies: + '@eslint/eslintrc': + specifier: ^3.0.2 + version: 3.0.2 + '@eslint/js': + specifier: ^9.0.0 + version: 9.0.0 + '@typescript-eslint/eslint-plugin': + specifier: ^6.4.0 + version: 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@9.0.0)(typescript@5.4.5) + acorn: + specifier: ^8.11.3 + version: 8.11.3 + eslint: + specifier: ^9.0.0 + version: 9.0.0 + eslint-config-standard-with-typescript: + specifier: ^43.0.1 + version: 43.0.1(@typescript-eslint/eslint-plugin@6.21.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.2)(eslint-plugin-promise@6.1.1)(eslint@9.0.0)(typescript@5.4.5) + eslint-plugin-import: + specifier: ^2.29.1 + version: 2.29.1(@typescript-eslint/parser@6.21.0)(eslint@9.0.0) + eslint-plugin-n: + specifier: ^16.6.2 + version: 16.6.2(eslint@9.0.0) + eslint-plugin-promise: + specifier: ^6.1.1 + version: 6.1.1(eslint@9.0.0) + globals: + specifier: ^15.0.0 + version: 15.0.0 + prettier: + specifier: ^3.2.5 + version: 3.2.5 + typescript: + specifier: ^5.4.5 + version: 5.4.5 + +packages: + + /@aashutoshrathi/word-wrap@1.2.6: + resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} + engines: {node: '>=0.10.0'} + dev: true + + /@eslint-community/eslint-utils@4.4.0(eslint@9.0.0): + resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + dependencies: + eslint: 9.0.0 + eslint-visitor-keys: 3.4.3 + dev: true + + /@eslint-community/regexpp@4.10.0: + resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + dev: true + + /@eslint/eslintrc@3.0.2: + resolution: {integrity: sha512-wV19ZEGEMAC1eHgrS7UQPqsdEiCIbTKTasEfcXAigzoXICcqZSjBZEHlZwNVvKg6UBCjSlos84XiLqsRJnIcIg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + ajv: 6.12.6 + debug: 4.3.4 + espree: 10.0.1 + globals: 14.0.0 + ignore: 5.3.1 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@eslint/js@9.0.0: + resolution: {integrity: sha512-RThY/MnKrhubF6+s1JflwUjPEsnCEmYCWwqa/aRISKWNXGZ9epUwft4bUMM35SdKF9xvBrLydAM1RDHd1Z//ZQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dev: true + + /@humanwhocodes/config-array@0.12.3: + resolution: {integrity: sha512-jsNnTBlMWuTpDkeE3on7+dWJi0D6fdDfeANj/w7MpS8ztROCoLvIO2nG0CcFj+E4k8j4QrSTh4Oryi3i2G669g==} + engines: {node: '>=10.10.0'} + dependencies: + '@humanwhocodes/object-schema': 2.0.3 + debug: 4.3.4 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@humanwhocodes/module-importer@1.0.1: + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + dev: true + + /@humanwhocodes/object-schema@2.0.3: + resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} + dev: true + + /@nodelib/fs.scandir@2.1.5: + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + dev: true + + /@nodelib/fs.stat@2.0.5: + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + dev: true + + /@nodelib/fs.walk@1.2.8: + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.17.1 + dev: true + + /@types/json-schema@7.0.15: + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + dev: true + + /@types/json5@0.0.29: + resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} + dev: true + + /@types/semver@7.5.8: + resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} + dev: true + + /@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0)(eslint@9.0.0)(typescript@5.4.5): + resolution: {integrity: sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@eslint-community/regexpp': 4.10.0 + '@typescript-eslint/parser': 6.21.0(eslint@9.0.0)(typescript@5.4.5) + '@typescript-eslint/scope-manager': 6.21.0 + '@typescript-eslint/type-utils': 6.21.0(eslint@9.0.0)(typescript@5.4.5) + '@typescript-eslint/utils': 6.21.0(eslint@9.0.0)(typescript@5.4.5) + '@typescript-eslint/visitor-keys': 6.21.0 + debug: 4.3.4 + eslint: 9.0.0 + graphemer: 1.4.0 + ignore: 5.3.1 + natural-compare: 1.4.0 + semver: 7.6.0 + ts-api-utils: 1.3.0(typescript@5.4.5) + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/parser@6.21.0(eslint@9.0.0)(typescript@5.4.5): + resolution: {integrity: sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 6.21.0 + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) + '@typescript-eslint/visitor-keys': 6.21.0 + debug: 4.3.4 + eslint: 9.0.0 + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/scope-manager@6.21.0: + resolution: {integrity: sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/visitor-keys': 6.21.0 + dev: true + + /@typescript-eslint/type-utils@6.21.0(eslint@9.0.0)(typescript@5.4.5): + resolution: {integrity: sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) + '@typescript-eslint/utils': 6.21.0(eslint@9.0.0)(typescript@5.4.5) + debug: 4.3.4 + eslint: 9.0.0 + ts-api-utils: 1.3.0(typescript@5.4.5) + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/types@6.21.0: + resolution: {integrity: sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==} + engines: {node: ^16.0.0 || >=18.0.0} + dev: true + + /@typescript-eslint/typescript-estree@6.21.0(typescript@5.4.5): + resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/visitor-keys': 6.21.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.3 + semver: 7.6.0 + ts-api-utils: 1.3.0(typescript@5.4.5) + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/utils@6.21.0(eslint@9.0.0)(typescript@5.4.5): + resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.0.0) + '@types/json-schema': 7.0.15 + '@types/semver': 7.5.8 + '@typescript-eslint/scope-manager': 6.21.0 + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) + eslint: 9.0.0 + semver: 7.6.0 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + + /@typescript-eslint/visitor-keys@6.21.0: + resolution: {integrity: sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.21.0 + eslint-visitor-keys: 3.4.3 + dev: true + + /acorn-jsx@5.3.2(acorn@8.11.3): + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + acorn: 8.11.3 + dev: true + + /acorn@8.11.3: + resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + + /ajv@6.12.6: + resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + dev: true + + /ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + dev: true + + /ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + dev: true + + /argparse@2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + dev: true + + /array-buffer-byte-length@1.0.1: + resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + is-array-buffer: 3.0.4 + dev: true + + /array-includes@3.1.8: + resolution: {integrity: sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.3 + es-object-atoms: 1.0.0 + get-intrinsic: 1.2.4 + is-string: 1.0.7 + dev: true + + /array-union@2.1.0: + resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} + engines: {node: '>=8'} + dev: true + + /array.prototype.findlastindex@1.2.5: + resolution: {integrity: sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.3 + es-errors: 1.3.0 + es-object-atoms: 1.0.0 + es-shim-unscopables: 1.0.2 + dev: true + + /array.prototype.flat@1.3.2: + resolution: {integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.3 + es-shim-unscopables: 1.0.2 + dev: true + + /array.prototype.flatmap@1.3.2: + resolution: {integrity: sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.3 + es-shim-unscopables: 1.0.2 + dev: true + + /arraybuffer.prototype.slice@1.0.3: + resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==} + engines: {node: '>= 0.4'} + dependencies: + array-buffer-byte-length: 1.0.1 + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.3 + es-errors: 1.3.0 + get-intrinsic: 1.2.4 + is-array-buffer: 3.0.4 + is-shared-array-buffer: 1.0.3 + dev: true + + /available-typed-arrays@1.0.7: + resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} + engines: {node: '>= 0.4'} + dependencies: + possible-typed-array-names: 1.0.0 + dev: true + + /balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: true + + /brace-expansion@1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: true + + /brace-expansion@2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + dependencies: + balanced-match: 1.0.2 + dev: true + + /braces@3.0.2: + resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + engines: {node: '>=8'} + dependencies: + fill-range: 7.0.1 + dev: true + + /builtin-modules@3.3.0: + resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} + engines: {node: '>=6'} + dev: true + + /builtins@5.1.0: + resolution: {integrity: sha512-SW9lzGTLvWTP1AY8xeAMZimqDrIaSdLQUcVr9DMef51niJ022Ri87SwRRKYm4A6iHfkPaiVUu/Duw2Wc4J7kKg==} + dependencies: + semver: 7.6.0 + dev: true + + /call-bind@1.0.7: + resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} + engines: {node: '>= 0.4'} + dependencies: + es-define-property: 1.0.0 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.4 + set-function-length: 1.2.2 + dev: true + + /callsites@3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + dev: true + + /chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + dev: true + + /color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + dev: true + + /color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: true + + /concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + dev: true + + /cross-spawn@7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + dev: true + + /data-view-buffer@1.0.1: + resolution: {integrity: sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-data-view: 1.0.1 + dev: true + + /data-view-byte-length@1.0.1: + resolution: {integrity: sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-data-view: 1.0.1 + dev: true + + /data-view-byte-offset@1.0.0: + resolution: {integrity: sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-data-view: 1.0.1 + dev: true + + /debug@3.2.7: + resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + dev: true + + /debug@4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + dev: true + + /deep-is@0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + dev: true + + /define-data-property@1.1.4: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + engines: {node: '>= 0.4'} + dependencies: + es-define-property: 1.0.0 + es-errors: 1.3.0 + gopd: 1.0.1 + dev: true + + /define-properties@1.2.1: + resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.4 + has-property-descriptors: 1.0.2 + object-keys: 1.1.1 + dev: true + + /dir-glob@3.0.1: + resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} + engines: {node: '>=8'} + dependencies: + path-type: 4.0.0 + dev: true + + /doctrine@2.1.0: + resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} + engines: {node: '>=0.10.0'} + dependencies: + esutils: 2.0.3 + dev: true + + /es-abstract@1.23.3: + resolution: {integrity: sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==} + engines: {node: '>= 0.4'} + dependencies: + array-buffer-byte-length: 1.0.1 + arraybuffer.prototype.slice: 1.0.3 + available-typed-arrays: 1.0.7 + call-bind: 1.0.7 + data-view-buffer: 1.0.1 + data-view-byte-length: 1.0.1 + data-view-byte-offset: 1.0.0 + es-define-property: 1.0.0 + es-errors: 1.3.0 + es-object-atoms: 1.0.0 + es-set-tostringtag: 2.0.3 + es-to-primitive: 1.2.1 + function.prototype.name: 1.1.6 + get-intrinsic: 1.2.4 + get-symbol-description: 1.0.2 + globalthis: 1.0.3 + gopd: 1.0.1 + has-property-descriptors: 1.0.2 + has-proto: 1.0.3 + has-symbols: 1.0.3 + hasown: 2.0.2 + internal-slot: 1.0.7 + is-array-buffer: 3.0.4 + is-callable: 1.2.7 + is-data-view: 1.0.1 + is-negative-zero: 2.0.3 + is-regex: 1.1.4 + is-shared-array-buffer: 1.0.3 + is-string: 1.0.7 + is-typed-array: 1.1.13 + is-weakref: 1.0.2 + object-inspect: 1.13.1 + object-keys: 1.1.1 + object.assign: 4.1.5 + regexp.prototype.flags: 1.5.2 + safe-array-concat: 1.1.2 + safe-regex-test: 1.0.3 + string.prototype.trim: 1.2.9 + string.prototype.trimend: 1.0.8 + string.prototype.trimstart: 1.0.8 + typed-array-buffer: 1.0.2 + typed-array-byte-length: 1.0.1 + typed-array-byte-offset: 1.0.2 + typed-array-length: 1.0.6 + unbox-primitive: 1.0.2 + which-typed-array: 1.1.15 + dev: true + + /es-define-property@1.0.0: + resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.4 + dev: true + + /es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + dev: true + + /es-object-atoms@1.0.0: + resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} + engines: {node: '>= 0.4'} + dependencies: + es-errors: 1.3.0 + dev: true + + /es-set-tostringtag@2.0.3: + resolution: {integrity: sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.4 + has-tostringtag: 1.0.2 + hasown: 2.0.2 + dev: true + + /es-shim-unscopables@1.0.2: + resolution: {integrity: sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==} + dependencies: + hasown: 2.0.2 + dev: true + + /es-to-primitive@1.2.1: + resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} + engines: {node: '>= 0.4'} + dependencies: + is-callable: 1.2.7 + is-date-object: 1.0.5 + is-symbol: 1.0.4 + dev: true + + /escape-string-regexp@4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + dev: true + + /eslint-compat-utils@0.5.0(eslint@9.0.0): + resolution: {integrity: sha512-dc6Y8tzEcSYZMHa+CMPLi/hyo1FzNeonbhJL7Ol0ccuKQkwopJcJBA9YL/xmMTLU1eKigXo9vj9nALElWYSowg==} + engines: {node: '>=12'} + peerDependencies: + eslint: '>=6.0.0' + dependencies: + eslint: 9.0.0 + semver: 7.6.0 + dev: true + + /eslint-config-standard-with-typescript@43.0.1(@typescript-eslint/eslint-plugin@6.21.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.2)(eslint-plugin-promise@6.1.1)(eslint@9.0.0)(typescript@5.4.5): + resolution: {integrity: sha512-WfZ986+qzIzX6dcr4yGUyVb/l9N3Z8wPXCc5z/70fljs3UbWhhV+WxrfgsqMToRzuuyX9MqZ974pq2UPhDTOcA==} + deprecated: Please use eslint-config-love, instead. + peerDependencies: + '@typescript-eslint/eslint-plugin': ^6.4.0 + eslint: ^8.0.1 + eslint-plugin-import: ^2.25.2 + eslint-plugin-n: '^15.0.0 || ^16.0.0 ' + eslint-plugin-promise: ^6.0.0 + typescript: '*' + dependencies: + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@9.0.0)(typescript@5.4.5) + '@typescript-eslint/parser': 6.21.0(eslint@9.0.0)(typescript@5.4.5) + eslint: 9.0.0 + eslint-config-standard: 17.1.0(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.2)(eslint-plugin-promise@6.1.1)(eslint@9.0.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0)(eslint@9.0.0) + eslint-plugin-n: 16.6.2(eslint@9.0.0) + eslint-plugin-promise: 6.1.1(eslint@9.0.0) + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-config-standard@17.1.0(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.2)(eslint-plugin-promise@6.1.1)(eslint@9.0.0): + resolution: {integrity: sha512-IwHwmaBNtDK4zDHQukFDW5u/aTb8+meQWZvNFWkiGmbWjD6bqyuSSBxxXKkCftCUzc1zwCH2m/baCNDLGmuO5Q==} + engines: {node: '>=12.0.0'} + peerDependencies: + eslint: ^8.0.1 + eslint-plugin-import: ^2.25.2 + eslint-plugin-n: '^15.0.0 || ^16.0.0 ' + eslint-plugin-promise: ^6.0.0 + dependencies: + eslint: 9.0.0 + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0)(eslint@9.0.0) + eslint-plugin-n: 16.6.2(eslint@9.0.0) + eslint-plugin-promise: 6.1.1(eslint@9.0.0) + dev: true + + /eslint-import-resolver-node@0.3.9: + resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} + dependencies: + debug: 3.2.7 + is-core-module: 2.13.1 + resolve: 1.22.8 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-module-utils@2.8.1(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-node@0.3.9)(eslint@9.0.0): + resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: '*' + eslint-import-resolver-node: '*' + eslint-import-resolver-typescript: '*' + eslint-import-resolver-webpack: '*' + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + eslint: + optional: true + eslint-import-resolver-node: + optional: true + eslint-import-resolver-typescript: + optional: true + eslint-import-resolver-webpack: + optional: true + dependencies: + '@typescript-eslint/parser': 6.21.0(eslint@9.0.0)(typescript@5.4.5) + debug: 3.2.7 + eslint: 9.0.0 + eslint-import-resolver-node: 0.3.9 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-plugin-es-x@7.6.0(eslint@9.0.0): + resolution: {integrity: sha512-I0AmeNgevgaTR7y2lrVCJmGYF0rjoznpDvqV/kIkZSZbZ8Rw3eu4cGlvBBULScfkSOCzqKbff5LR4CNrV7mZHA==} + engines: {node: ^14.18.0 || >=16.0.0} + peerDependencies: + eslint: '>=8' + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.0.0) + '@eslint-community/regexpp': 4.10.0 + eslint: 9.0.0 + eslint-compat-utils: 0.5.0(eslint@9.0.0) + dev: true + + /eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0)(eslint@9.0.0): + resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + dependencies: + '@typescript-eslint/parser': 6.21.0(eslint@9.0.0)(typescript@5.4.5) + array-includes: 3.1.8 + array.prototype.findlastindex: 1.2.5 + array.prototype.flat: 1.3.2 + array.prototype.flatmap: 1.3.2 + debug: 3.2.7 + doctrine: 2.1.0 + eslint: 9.0.0 + eslint-import-resolver-node: 0.3.9 + eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-node@0.3.9)(eslint@9.0.0) + hasown: 2.0.2 + is-core-module: 2.13.1 + is-glob: 4.0.3 + minimatch: 3.1.2 + object.fromentries: 2.0.8 + object.groupby: 1.0.3 + object.values: 1.2.0 + semver: 6.3.1 + tsconfig-paths: 3.15.0 + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + dev: true + + /eslint-plugin-n@16.6.2(eslint@9.0.0): + resolution: {integrity: sha512-6TyDmZ1HXoFQXnhCTUjVFULReoBPOAjpuiKELMkeP40yffI/1ZRO+d9ug/VC6fqISo2WkuIBk3cvuRPALaWlOQ==} + engines: {node: '>=16.0.0'} + peerDependencies: + eslint: '>=7.0.0' + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.0.0) + builtins: 5.1.0 + eslint: 9.0.0 + eslint-plugin-es-x: 7.6.0(eslint@9.0.0) + get-tsconfig: 4.7.3 + globals: 13.24.0 + ignore: 5.3.1 + is-builtin-module: 3.2.1 + is-core-module: 2.13.1 + minimatch: 3.1.2 + resolve: 1.22.8 + semver: 7.6.0 + dev: true + + /eslint-plugin-promise@6.1.1(eslint@9.0.0): + resolution: {integrity: sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + dependencies: + eslint: 9.0.0 + dev: true + + /eslint-scope@8.0.1: + resolution: {integrity: sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + dev: true + + /eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + + /eslint-visitor-keys@4.0.0: + resolution: {integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dev: true + + /eslint@9.0.0: + resolution: {integrity: sha512-IMryZ5SudxzQvuod6rUdIUz29qFItWx281VhtFVc2Psy/ZhlCeD/5DT6lBIJ4H3G+iamGJoTln1v+QSuPw0p7Q==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + hasBin: true + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.0.0) + '@eslint-community/regexpp': 4.10.0 + '@eslint/eslintrc': 3.0.2 + '@eslint/js': 9.0.0 + '@humanwhocodes/config-array': 0.12.3 + '@humanwhocodes/module-importer': 1.0.1 + '@nodelib/fs.walk': 1.2.8 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.3 + debug: 4.3.4 + escape-string-regexp: 4.0.0 + eslint-scope: 8.0.1 + eslint-visitor-keys: 4.0.0 + espree: 10.0.1 + esquery: 1.5.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 8.0.0 + find-up: 5.0.0 + glob-parent: 6.0.2 + graphemer: 1.4.0 + ignore: 5.3.1 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.3 + strip-ansi: 6.0.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + dev: true + + /espree@10.0.1: + resolution: {integrity: sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + acorn: 8.11.3 + acorn-jsx: 5.3.2(acorn@8.11.3) + eslint-visitor-keys: 4.0.0 + dev: true + + /esquery@1.5.0: + resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} + engines: {node: '>=0.10'} + dependencies: + estraverse: 5.3.0 + dev: true + + /esrecurse@4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + dependencies: + estraverse: 5.3.0 + dev: true + + /estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + dev: true + + /esutils@2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + dev: true + + /fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + dev: true + + /fast-glob@3.3.2: + resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} + engines: {node: '>=8.6.0'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.5 + dev: true + + /fast-json-stable-stringify@2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + dev: true + + /fast-levenshtein@2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + dev: true + + /fastq@1.17.1: + resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} + dependencies: + reusify: 1.0.4 + dev: true + + /file-entry-cache@8.0.0: + resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} + engines: {node: '>=16.0.0'} + dependencies: + flat-cache: 4.0.1 + dev: true + + /fill-range@7.0.1: + resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + engines: {node: '>=8'} + dependencies: + to-regex-range: 5.0.1 + dev: true + + /find-up@5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + dev: true + + /flat-cache@4.0.1: + resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} + engines: {node: '>=16'} + dependencies: + flatted: 3.3.1 + keyv: 4.5.4 + dev: true + + /flatted@3.3.1: + resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} + dev: true + + /for-each@0.3.3: + resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} + dependencies: + is-callable: 1.2.7 + dev: true + + /function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + dev: true + + /function.prototype.name@1.1.6: + resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.3 + functions-have-names: 1.2.3 + dev: true + + /functions-have-names@1.2.3: + resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} + dev: true + + /get-intrinsic@1.2.4: + resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} + engines: {node: '>= 0.4'} + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + has-proto: 1.0.3 + has-symbols: 1.0.3 + hasown: 2.0.2 + dev: true + + /get-symbol-description@1.0.2: + resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + get-intrinsic: 1.2.4 + dev: true + + /get-tsconfig@4.7.3: + resolution: {integrity: sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==} + dependencies: + resolve-pkg-maps: 1.0.0 + dev: true + + /glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + dependencies: + is-glob: 4.0.3 + dev: true + + /glob-parent@6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + dependencies: + is-glob: 4.0.3 + dev: true + + /globals@13.24.0: + resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} + engines: {node: '>=8'} + dependencies: + type-fest: 0.20.2 + dev: true + + /globals@14.0.0: + resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} + engines: {node: '>=18'} + dev: true + + /globals@15.0.0: + resolution: {integrity: sha512-m/C/yR4mjO6pXDTm9/R/SpYTAIyaUB4EOzcaaMEl7mds7Mshct9GfejiJNQGjHHbdMPey13Kpu4TMbYi9ex1pw==} + engines: {node: '>=18'} + dev: true + + /globalthis@1.0.3: + resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} + engines: {node: '>= 0.4'} + dependencies: + define-properties: 1.2.1 + dev: true + + /globby@11.1.0: + resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} + engines: {node: '>=10'} + dependencies: + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.3.2 + ignore: 5.3.1 + merge2: 1.4.1 + slash: 3.0.0 + dev: true + + /gopd@1.0.1: + resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + dependencies: + get-intrinsic: 1.2.4 + dev: true + + /graphemer@1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + dev: true + + /has-bigints@1.0.2: + resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} + dev: true + + /has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + dev: true + + /has-property-descriptors@1.0.2: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + dependencies: + es-define-property: 1.0.0 + dev: true + + /has-proto@1.0.3: + resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} + engines: {node: '>= 0.4'} + dev: true + + /has-symbols@1.0.3: + resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} + engines: {node: '>= 0.4'} + dev: true + + /has-tostringtag@1.0.2: + resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.3 + dev: true + + /hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + dependencies: + function-bind: 1.1.2 + dev: true + + /ignore@5.3.1: + resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} + engines: {node: '>= 4'} + dev: true + + /import-fresh@3.3.0: + resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} + engines: {node: '>=6'} + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + dev: true + + /imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + dev: true + + /internal-slot@1.0.7: + resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==} + engines: {node: '>= 0.4'} + dependencies: + es-errors: 1.3.0 + hasown: 2.0.2 + side-channel: 1.0.6 + dev: true + + /is-array-buffer@3.0.4: + resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + get-intrinsic: 1.2.4 + dev: true + + /is-bigint@1.0.4: + resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} + dependencies: + has-bigints: 1.0.2 + dev: true + + /is-boolean-object@1.1.2: + resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + has-tostringtag: 1.0.2 + dev: true + + /is-builtin-module@3.2.1: + resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} + engines: {node: '>=6'} + dependencies: + builtin-modules: 3.3.0 + dev: true + + /is-callable@1.2.7: + resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} + engines: {node: '>= 0.4'} + dev: true + + /is-core-module@2.13.1: + resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} + dependencies: + hasown: 2.0.2 + dev: true + + /is-data-view@1.0.1: + resolution: {integrity: sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==} + engines: {node: '>= 0.4'} + dependencies: + is-typed-array: 1.1.13 + dev: true + + /is-date-object@1.0.5: + resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.2 + dev: true + + /is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + dev: true + + /is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + dependencies: + is-extglob: 2.1.1 + dev: true + + /is-negative-zero@2.0.3: + resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} + engines: {node: '>= 0.4'} + dev: true + + /is-number-object@1.0.7: + resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.2 + dev: true + + /is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + dev: true + + /is-path-inside@3.0.3: + resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} + engines: {node: '>=8'} + dev: true + + /is-regex@1.1.4: + resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + has-tostringtag: 1.0.2 + dev: true + + /is-shared-array-buffer@1.0.3: + resolution: {integrity: sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + dev: true + + /is-string@1.0.7: + resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.2 + dev: true + + /is-symbol@1.0.4: + resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.3 + dev: true + + /is-typed-array@1.1.13: + resolution: {integrity: sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==} + engines: {node: '>= 0.4'} + dependencies: + which-typed-array: 1.1.15 + dev: true + + /is-weakref@1.0.2: + resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} + dependencies: + call-bind: 1.0.7 + dev: true + + /isarray@2.0.5: + resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} + dev: true + + /isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + dev: true + + /js-yaml@4.1.0: + resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} + hasBin: true + dependencies: + argparse: 2.0.1 + dev: true + + /json-buffer@3.0.1: + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + dev: true + + /json-schema-traverse@0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + dev: true + + /json-stable-stringify-without-jsonify@1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + dev: true + + /json5@1.0.2: + resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==} + hasBin: true + dependencies: + minimist: 1.2.8 + dev: true + + /keyv@4.5.4: + resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + dependencies: + json-buffer: 3.0.1 + dev: true + + /levn@0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + dev: true + + /locate-path@6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + dependencies: + p-locate: 5.0.0 + dev: true + + /lodash.merge@4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + dev: true + + /lru-cache@6.0.0: + resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} + engines: {node: '>=10'} + dependencies: + yallist: 4.0.0 + dev: true + + /merge2@1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + dev: true + + /micromatch@4.0.5: + resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} + engines: {node: '>=8.6'} + dependencies: + braces: 3.0.2 + picomatch: 2.3.1 + dev: true + + /minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + dev: true + + /minimatch@9.0.3: + resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + brace-expansion: 2.0.1 + dev: true + + /minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + dev: true + + /ms@2.1.2: + resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + dev: true + + /natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + dev: true + + /object-inspect@1.13.1: + resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} + dev: true + + /object-keys@1.1.1: + resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} + engines: {node: '>= 0.4'} + dev: true + + /object.assign@4.1.5: + resolution: {integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + has-symbols: 1.0.3 + object-keys: 1.1.1 + dev: true + + /object.fromentries@2.0.8: + resolution: {integrity: sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.3 + es-object-atoms: 1.0.0 + dev: true + + /object.groupby@1.0.3: + resolution: {integrity: sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.3 + dev: true + + /object.values@1.2.0: + resolution: {integrity: sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-object-atoms: 1.0.0 + dev: true + + /optionator@0.9.3: + resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} + engines: {node: '>= 0.8.0'} + dependencies: + '@aashutoshrathi/word-wrap': 1.2.6 + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + dev: true + + /p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + dependencies: + yocto-queue: 0.1.0 + dev: true + + /p-locate@5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + dependencies: + p-limit: 3.1.0 + dev: true + + /parent-module@1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} + dependencies: + callsites: 3.1.0 + dev: true + + /path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + dev: true + + /path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + dev: true + + /path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + dev: true + + /path-type@4.0.0: + resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} + engines: {node: '>=8'} + dev: true + + /picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + dev: true + + /possible-typed-array-names@1.0.0: + resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} + engines: {node: '>= 0.4'} + dev: true + + /prelude-ls@1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + dev: true + + /prettier@3.2.5: + resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} + engines: {node: '>=14'} + hasBin: true + dev: true + + /punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + dev: true + + /queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + dev: true + + /regexp.prototype.flags@1.5.2: + resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-errors: 1.3.0 + set-function-name: 2.0.2 + dev: true + + /resolve-from@4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + dev: true + + /resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + dev: true + + /resolve@1.22.8: + resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} + hasBin: true + dependencies: + is-core-module: 2.13.1 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: true + + /reusify@1.0.4: + resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + dev: true + + /run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + dependencies: + queue-microtask: 1.2.3 + dev: true + + /safe-array-concat@1.1.2: + resolution: {integrity: sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==} + engines: {node: '>=0.4'} + dependencies: + call-bind: 1.0.7 + get-intrinsic: 1.2.4 + has-symbols: 1.0.3 + isarray: 2.0.5 + dev: true + + /safe-regex-test@1.0.3: + resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-regex: 1.1.4 + dev: true + + /semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + dev: true + + /semver@7.6.0: + resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + dev: true + + /set-function-length@1.2.2: + resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.4 + gopd: 1.0.1 + has-property-descriptors: 1.0.2 + dev: true + + /set-function-name@2.0.2: + resolution: {integrity: sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + functions-have-names: 1.2.3 + has-property-descriptors: 1.0.2 + dev: true + + /shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + dependencies: + shebang-regex: 3.0.0 + dev: true + + /shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + dev: true + + /side-channel@1.0.6: + resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + get-intrinsic: 1.2.4 + object-inspect: 1.13.1 + dev: true + + /slash@3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + dev: true + + /string.prototype.trim@1.2.9: + resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.3 + es-object-atoms: 1.0.0 + dev: true + + /string.prototype.trimend@1.0.8: + resolution: {integrity: sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-object-atoms: 1.0.0 + dev: true + + /string.prototype.trimstart@1.0.8: + resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-object-atoms: 1.0.0 + dev: true + + /strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + dependencies: + ansi-regex: 5.0.1 + dev: true + + /strip-bom@3.0.0: + resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} + engines: {node: '>=4'} + dev: true + + /strip-json-comments@3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + dev: true + + /supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + dependencies: + has-flag: 4.0.0 + dev: true + + /supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + dev: true + + /text-table@0.2.0: + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + dev: true + + /to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + dependencies: + is-number: 7.0.0 + dev: true + + /ts-api-utils@1.3.0(typescript@5.4.5): + resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} + engines: {node: '>=16'} + peerDependencies: + typescript: '>=4.2.0' + dependencies: + typescript: 5.4.5 + dev: true + + /tsconfig-paths@3.15.0: + resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} + dependencies: + '@types/json5': 0.0.29 + json5: 1.0.2 + minimist: 1.2.8 + strip-bom: 3.0.0 + dev: true + + /type-check@0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.2.1 + dev: true + + /type-fest@0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + engines: {node: '>=10'} + dev: true + + /typed-array-buffer@1.0.2: + resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-typed-array: 1.1.13 + dev: true + + /typed-array-byte-length@1.0.1: + resolution: {integrity: sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.0.1 + has-proto: 1.0.3 + is-typed-array: 1.1.13 + dev: true + + /typed-array-byte-offset@1.0.2: + resolution: {integrity: sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.0.1 + has-proto: 1.0.3 + is-typed-array: 1.1.13 + dev: true + + /typed-array-length@1.0.6: + resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.0.1 + has-proto: 1.0.3 + is-typed-array: 1.1.13 + possible-typed-array-names: 1.0.0 + dev: true + + /typescript@5.4.5: + resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} + engines: {node: '>=14.17'} + hasBin: true + dev: true + + /unbox-primitive@1.0.2: + resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} + dependencies: + call-bind: 1.0.7 + has-bigints: 1.0.2 + has-symbols: 1.0.3 + which-boxed-primitive: 1.0.2 + dev: true + + /uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + dependencies: + punycode: 2.3.1 + dev: true + + /which-boxed-primitive@1.0.2: + resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} + dependencies: + is-bigint: 1.0.4 + is-boolean-object: 1.1.2 + is-number-object: 1.0.7 + is-string: 1.0.7 + is-symbol: 1.0.4 + dev: true + + /which-typed-array@1.1.15: + resolution: {integrity: sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.0.1 + has-tostringtag: 1.0.2 + dev: true + + /which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + dependencies: + isexe: 2.0.0 + dev: true + + /yallist@4.0.0: + resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + dev: true + + /yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + dev: true diff --git a/settings/v2/packages/cocos-service.json b/settings/v2/packages/cocos-service.json index 3625375..fdc6e57 100644 --- a/settings/v2/packages/cocos-service.json +++ b/settings/v2/packages/cocos-service.json @@ -1,7 +1,7 @@ { "__version__": "3.0.5", "game": { - "name": "未知游戏", + "name": "UNKNOW GAME", "app_id": "UNKNOW", "c_id": "0" }, diff --git a/settings/v2/packages/information.json b/settings/v2/packages/information.json index 60654ad..94848de 100644 --- a/settings/v2/packages/information.json +++ b/settings/v2/packages/information.json @@ -4,19 +4,19 @@ "customSplash": { "id": "customSplash", "label": "customSplash", - "enable": true, + "enable": false, "customSplash": { "complete": false, - "form": "https://creator-api.cocos.com/api/form/show?sid=5d73e8c847732207609c34c0adf271fb" + "form": "https://creator-api.cocos.com/api/form/show?" } }, "removeSplash": { "id": "removeSplash", "label": "removeSplash", - "enable": true, + "enable": false, "removeSplash": { - "complete": true, - "form": "https://creator-api.cocos.com/api/form/show?sid=5d73e8c847732207609c34c0adf271fb" + "complete": false, + "form": "https://creator-api.cocos.com/api/form/show?" } } }