import JNSyncFrame, { JNFrameInfo } from "../../../extensions/ngame/assets/ngame/sync/frame/JNSyncFrame";
import JNSyncFrameComponent from "../../../extensions/ngame/assets/ngame/sync/frame/game/JNSyncFrameComponent";
import JNSyncFrameProtoComponent from "../../../extensions/ngame/assets/ngame/sync/frame/game/JNSyncFrameProtoComponent";
import JNLayerBase from "../../../extensions/ngame/assets/ngame/ui/base/JNLayerBase";
import { app } from "../App";

//重写UI Base
export class JNGLayerBase extends JNLayerBase{
    public close():void {
        console.log("close");
        app.layer.CloseNode(this.node);
    }
}

//重写Sync Base
export class JNGSyncBase<T> extends JNSyncFrameComponent<T>{
    onSyncLoad() { }
    onSyncUpdate(dt: number,frame:JNFrameInfo, input?: T) { }
    protected getSync(): JNSyncFrame {
        return app.sync
    }

}
//重写Sync Proto Base
export abstract class JNGSyncProtoBase<T> extends JNSyncFrameProtoComponent<T>{

    onSyncLoad() { }
    onSyncUpdate(dt: number,frame:JNFrameInfo, input?: T) { }
    protected getSync(): JNSyncFrame {
        return app.sync
    }

}