@benjos/create-boilerplate 1.3.2 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -7
- package/template-react/package-lock.json +4466 -4488
- package/template-react/package.json +45 -46
- package/template-react/tsconfig.app.json +12 -6
- package/template-vanilla/eslint.config.js +0 -1
- package/template-vanilla/package-lock.json +421 -425
- package/template-vanilla/package.json +13 -12
- package/template-vanilla/src/experiences/cameras/threes/DebugThreeCameraController.ts +2 -2
- package/template-vanilla/src/experiences/commands/InitCommand.ts +10 -5
- package/template-vanilla/src/experiences/engines/threes/MainThree.ts +8 -8
- package/template-vanilla/src/experiences/managers/DebugManager.ts +3 -3
- package/template-vanilla/src/experiences/managers/KeyboardManager.ts +2 -2
- package/template-vanilla/src/experiences/managers/LoaderManager.ts +1 -1
- package/template-vanilla/src/experiences/managers/MouseManager.ts +2 -2
- package/template-vanilla/src/experiences/managers/ResizeManager.ts +1 -1
- package/template-vanilla/src/experiences/managers/threes/ThreeAssetsManager.ts +5 -6
- package/template-vanilla/src/experiences/managers/threes/ThreeCameraControllerManager.ts +1 -1
- package/template-vanilla/src/experiences/types/global.d.ts +3 -2
- package/template-vanilla/src/experiences/views/htmls/bases/HTMLViewBase.ts +3 -3
- package/template-vanilla/src/experiences/views/htmls/loaders/LoaderHTMLView.ts +3 -3
- package/template-vanilla/src/experiences/constants/doms/DomEvent.ts +0 -100
- package/template-vanilla/src/experiences/constants/doms/KeyboardConstant.ts +0 -250
- package/template-vanilla/src/experiences/proxies/bases/PoolProxyBase.ts +0 -61
- package/template-vanilla/src/experiences/tools/Action.ts +0 -23
- package/template-vanilla/src/experiences/tools/Point.ts +0 -56
- package/template-vanilla/src/experiences/utils/AssetUtils.ts +0 -6
- package/template-vanilla/src/experiences/utils/DomUtils.ts +0 -28
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
type Constructor<T> = new () => T;
|
|
2
|
-
|
|
3
|
-
export default abstract class PoolProxyBase<T = unknown> {
|
|
4
|
-
protected readonly _pool: Set<T> = new Set<T>();
|
|
5
|
-
private readonly _ctor: Constructor<T>;
|
|
6
|
-
|
|
7
|
-
//#region Constants
|
|
8
|
-
//
|
|
9
|
-
private static readonly _DEFAULT_INITIAL_SIZE: number = 0;
|
|
10
|
-
//
|
|
11
|
-
//#endregion
|
|
12
|
-
|
|
13
|
-
constructor(ctor: Constructor<T>, initialSize: number = PoolProxyBase._DEFAULT_INITIAL_SIZE) {
|
|
14
|
-
this._ctor = ctor;
|
|
15
|
-
this._prepopulate(initialSize);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
private _prepopulate(number: number): void {
|
|
19
|
-
for (let i = 0; i < number; i++) {
|
|
20
|
-
this._pool.add(new this._ctor());
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
public get(): T {
|
|
25
|
-
if (this._pool.size > 0) {
|
|
26
|
-
const o = this._pool.values().next().value!;
|
|
27
|
-
this._pool.delete(o);
|
|
28
|
-
return o;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return new this._ctor();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
public release(o: T): void {
|
|
35
|
-
this._pool.add(o);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
//#region TEMPLATE USAGE
|
|
40
|
-
//
|
|
41
|
-
// class TemplatePoolProxy extends PoolProxyBase<TemplateObject> {
|
|
42
|
-
// constructor() {
|
|
43
|
-
// super(TemplateObject);
|
|
44
|
-
// }
|
|
45
|
-
|
|
46
|
-
// public override get(): TemplateObject {
|
|
47
|
-
// const o = super.get();
|
|
48
|
-
// // Do any additional initialization here if necessary
|
|
49
|
-
// return o;
|
|
50
|
-
// }
|
|
51
|
-
|
|
52
|
-
// public override release(o: TemplateObject): void {
|
|
53
|
-
// // Do any additional cleanup here if necessary
|
|
54
|
-
// super.release(o);
|
|
55
|
-
// }
|
|
56
|
-
// }
|
|
57
|
-
|
|
58
|
-
// const instance = new TemplatePoolProxy();
|
|
59
|
-
// export { instance as TemplatePoolProxy };
|
|
60
|
-
//
|
|
61
|
-
//#endregion
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
type Listener<TParams extends unknown[]> = (...params: TParams) => unknown;
|
|
2
|
-
|
|
3
|
-
export default class Action<T extends unknown[] = []> {
|
|
4
|
-
private _listeners = new Set<Listener<T>>();
|
|
5
|
-
|
|
6
|
-
public add(listener: Listener<T>): void {
|
|
7
|
-
this._listeners.add(listener);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
public remove(listener: Listener<T>): void {
|
|
11
|
-
this._listeners.delete(listener);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
public removeAll(): void {
|
|
15
|
-
this._listeners.clear();
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
public execute(...params: T): void {
|
|
19
|
-
for (const listener of this._listeners) {
|
|
20
|
-
listener(...params);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
export default class Point {
|
|
2
|
-
private _x: number;
|
|
3
|
-
private _y: number;
|
|
4
|
-
private _z: number;
|
|
5
|
-
|
|
6
|
-
constructor(x = 0, y = 0, z = 0) {
|
|
7
|
-
this._x = x;
|
|
8
|
-
this._y = y;
|
|
9
|
-
this._z = z;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
public set(x: number, y: number, z: number = this._z): void {
|
|
13
|
-
this._x = x;
|
|
14
|
-
this._y = y;
|
|
15
|
-
this._z = z;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
public clear(): void {
|
|
19
|
-
this._x = 0;
|
|
20
|
-
this._y = 0;
|
|
21
|
-
this._z = 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
public copy(p: Point): void {
|
|
25
|
-
this._x = p.x;
|
|
26
|
-
this._y = p.y;
|
|
27
|
-
this._z = p.z;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
public clone(): Point {
|
|
31
|
-
return new Point(this._x, this._y, this._z);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
//#region getter setter
|
|
35
|
-
//
|
|
36
|
-
public get x(): number {
|
|
37
|
-
return this._x;
|
|
38
|
-
}
|
|
39
|
-
public set x(x: number) {
|
|
40
|
-
this._x = x;
|
|
41
|
-
}
|
|
42
|
-
public get y(): number {
|
|
43
|
-
return this._y;
|
|
44
|
-
}
|
|
45
|
-
public set y(y: number) {
|
|
46
|
-
this._y = y;
|
|
47
|
-
}
|
|
48
|
-
public get z(): number {
|
|
49
|
-
return this._z;
|
|
50
|
-
}
|
|
51
|
-
public set z(z: number) {
|
|
52
|
-
this._z = z;
|
|
53
|
-
}
|
|
54
|
-
//
|
|
55
|
-
//#endregion
|
|
56
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export default class DomUtils {
|
|
2
|
-
public static GetApp(): HTMLDivElement {
|
|
3
|
-
const app = (document.querySelector('#app') ?? document.querySelector('#root'))!;
|
|
4
|
-
|
|
5
|
-
if (!app) {
|
|
6
|
-
const newApp = document.createElement('div');
|
|
7
|
-
newApp.id = 'app';
|
|
8
|
-
document.body.appendChild(newApp);
|
|
9
|
-
return newApp;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return app as HTMLDivElement;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public static GetLoader(): HTMLDivElement {
|
|
16
|
-
const loader = document.querySelector('#loader')!;
|
|
17
|
-
|
|
18
|
-
if (!loader) {
|
|
19
|
-
const app = DomUtils.GetApp();
|
|
20
|
-
const newLoader = document.createElement('div');
|
|
21
|
-
newLoader.id = 'loader';
|
|
22
|
-
app.appendChild(newLoader);
|
|
23
|
-
return newLoader;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return loader as HTMLDivElement;
|
|
27
|
-
}
|
|
28
|
-
}
|