@skewedaspect/sage 0.5.0 → 0.5.1
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/dist/classes/bindings/toggle.d.ts +4 -4
- package/dist/classes/bindings/trigger.d.ts +4 -4
- package/dist/classes/bindings/value.d.ts +4 -4
- package/dist/classes/entity.d.ts +2 -2
- package/dist/classes/eventBus.d.ts +1 -1
- package/dist/classes/gameEngine.d.ts +8 -8
- package/dist/classes/input/gamepad.d.ts +1 -1
- package/dist/classes/input/keyboard.d.ts +1 -1
- package/dist/classes/input/mouse.d.ts +1 -1
- package/dist/classes/input/readers/gamepad.d.ts +1 -1
- package/dist/classes/input/readers/keyboard.d.ts +1 -1
- package/dist/classes/input/readers/mouse.d.ts +1 -1
- package/dist/classes/loggers/consoleBackend.d.ts +1 -1
- package/dist/classes/loggers/nullBackend.d.ts +1 -1
- package/dist/engines/scene.d.ts +2 -2
- package/dist/interfaces/binding.d.ts +4 -11
- package/dist/interfaces/entity.d.ts +5 -5
- package/dist/interfaces/game.d.ts +2 -2
- package/dist/managers/binding.d.ts +5 -5
- package/dist/managers/entity.d.ts +7 -7
- package/dist/managers/game.d.ts +5 -5
- package/dist/managers/input.d.ts +3 -3
- package/dist/managers/level.d.ts +1 -2
- package/dist/sage.d.ts +16 -14
- package/dist/sage.es.js +129 -71
- package/dist/sage.es.js.map +1 -1
- package/dist/sage.umd.js +1 -1
- package/dist/sage.umd.js.map +1 -1
- package/dist/utils/graphics.d.ts +1 -1
- package/dist/utils/logger.d.ts +3 -3
- package/package.json +11 -7
- package/src/classes/bindings/toggle.ts +0 -261
- package/src/classes/bindings/trigger.ts +0 -211
- package/src/classes/bindings/value.ts +0 -227
- package/src/classes/entity.ts +0 -256
- package/src/classes/eventBus.ts +0 -259
- package/src/classes/gameEngine.ts +0 -125
- package/src/classes/input/gamepad.ts +0 -388
- package/src/classes/input/keyboard.ts +0 -189
- package/src/classes/input/mouse.ts +0 -276
- package/src/classes/input/readers/gamepad.ts +0 -179
- package/src/classes/input/readers/keyboard.ts +0 -123
- package/src/classes/input/readers/mouse.ts +0 -133
- package/src/classes/loggers/consoleBackend.ts +0 -135
- package/src/classes/loggers/nullBackend.ts +0 -51
- package/src/engines/scene.ts +0 -112
- package/src/images/sage_logo.svg +0 -172
- package/src/images/sage_logo_shape.svg +0 -146
- package/src/interfaces/action.ts +0 -30
- package/src/interfaces/binding.ts +0 -191
- package/src/interfaces/entity.ts +0 -21
- package/src/interfaces/game.ts +0 -44
- package/src/interfaces/input.ts +0 -221
- package/src/interfaces/logger.ts +0 -118
- package/src/managers/binding.ts +0 -729
- package/src/managers/entity.ts +0 -252
- package/src/managers/game.ts +0 -111
- package/src/managers/input.ts +0 -233
- package/src/managers/level.ts +0 -261
- package/src/sage.ts +0 -122
- package/src/types/global.d.ts +0 -11
- package/src/utils/capabilities.ts +0 -16
- package/src/utils/graphics.ts +0 -148
- package/src/utils/logger.ts +0 -225
- package/src/utils/physics.ts +0 -16
- package/src/utils/version.ts +0 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { GameEventBus } from "../eventBus.d.ts";
|
|
2
|
+
import { Action } from "../../interfaces/action.d.ts";
|
|
3
|
+
import { Binding, ToggleBindingDefinition } from "../../interfaces/binding.d.ts";
|
|
4
|
+
import { DeviceValueReader, InputState } from "../../interfaces/input.d.ts";
|
|
5
5
|
/**
|
|
6
6
|
* Options for configuring a toggle binding
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { GameEventBus } from "../eventBus.d.ts";
|
|
2
|
+
import { Action } from "../../interfaces/action.d.ts";
|
|
3
|
+
import { Binding, TriggerBindingDefinition } from "../../interfaces/binding.d.ts";
|
|
4
|
+
import { DeviceValueReader, InputState } from "../../interfaces/input.d.ts";
|
|
5
5
|
/**
|
|
6
6
|
* All supported edge modes for validation
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { GameEventBus } from "../eventBus.d.ts";
|
|
2
|
+
import { Action } from "../../interfaces/action.d.ts";
|
|
3
|
+
import { Binding, ValueBindingDefinition } from "../../interfaces/binding.d.ts";
|
|
4
|
+
import { DeviceValueReader, InputState } from "../../interfaces/input.d.ts";
|
|
5
5
|
/**
|
|
6
6
|
* Options for configuring a value binding
|
|
7
7
|
*/
|
package/dist/classes/entity.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { GameEntityBehaviorConstructor } from "../interfaces/entity.d.ts";
|
|
2
|
+
import { GameEvent, GameEventBus } from "./eventBus.d.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Interface representing the context of a game entity.
|
|
5
5
|
* @template EntityState - The type of the state object.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AbstractEngine, HavokPlugin } from '@babylonjs/core';
|
|
2
|
-
import { GameCanvas } from
|
|
3
|
-
import { SceneEngine } from
|
|
4
|
-
import { BindingManager } from
|
|
5
|
-
import { GameManager } from
|
|
6
|
-
import { GameEntityManager } from
|
|
7
|
-
import { UserInputManager } from
|
|
8
|
-
import { GameEventBus } from
|
|
9
|
-
import { LoggingUtility } from
|
|
2
|
+
import { GameCanvas } from "../interfaces/game.d.ts";
|
|
3
|
+
import { SceneEngine } from "../engines/scene.d.ts";
|
|
4
|
+
import { BindingManager } from "../managers/binding.d.ts";
|
|
5
|
+
import { GameManager } from "../managers/game.d.ts";
|
|
6
|
+
import { GameEntityManager } from "../managers/entity.d.ts";
|
|
7
|
+
import { UserInputManager } from "../managers/input.d.ts";
|
|
8
|
+
import { GameEventBus } from "./eventBus.d.ts";
|
|
9
|
+
import { LoggingUtility } from "../utils/logger.d.ts";
|
|
10
10
|
/**
|
|
11
11
|
* Interface representing the engines used in the game.
|
|
12
12
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { DeviceValueReader, InputState, KeyboardValueReaderDefinition } from "../../../interfaces/input.d.ts";
|
|
2
2
|
/**
|
|
3
3
|
* Types of keyboard input sources
|
|
4
4
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { LoggingBackend } from "../../interfaces/logger.d.ts";
|
|
2
2
|
/**
|
|
3
3
|
* A logging backend that does nothing (discards all logs).
|
|
4
4
|
* Useful for production environments or when you want to completely disable logging.
|
package/dist/engines/scene.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AbstractEngine, HavokPlugin, Scene } from '@babylonjs/core';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import { GameCanvas } from "../interfaces/game.d.ts";
|
|
3
|
+
import { LoggingUtility } from "../utils/logger.d.ts";
|
|
4
4
|
export declare class SceneEngine {
|
|
5
5
|
private _engine;
|
|
6
6
|
private _physics;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { GameEventBus } from "../classes/eventBus.d.ts";
|
|
2
|
+
import { DeviceValueReader, DeviceValueReaderDefinition, InputState } from "./input.d.ts";
|
|
3
|
+
import { Action } from "./action.d.ts";
|
|
4
4
|
/**
|
|
5
5
|
* Types of bindings supported by the system
|
|
6
6
|
*/
|
|
@@ -93,17 +93,10 @@ export interface ValueBindingDefinition extends BindingDefinitionBase {
|
|
|
93
93
|
deadzone?: number;
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
/**
|
|
97
|
-
* Generic binding definition (for any other binding types)
|
|
98
|
-
*/
|
|
99
|
-
export interface GenericBindingDefinition extends BindingDefinitionBase {
|
|
100
|
-
type: Exclude<BindingType, 'trigger' | 'toggle' | 'value'>;
|
|
101
|
-
options?: Record<string, any>;
|
|
102
|
-
}
|
|
103
96
|
/**
|
|
104
97
|
* Union type of all binding definitions
|
|
105
98
|
*/
|
|
106
|
-
export type BindingDefinition = TriggerBindingDefinition | ToggleBindingDefinition | ValueBindingDefinition
|
|
99
|
+
export type BindingDefinition = TriggerBindingDefinition | ToggleBindingDefinition | ValueBindingDefinition;
|
|
107
100
|
/**
|
|
108
101
|
* Base interface for all input bindings
|
|
109
102
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { GameEntityBehavior } from
|
|
2
|
-
import { Action } from
|
|
1
|
+
import { GameEntityBehavior } from "../classes/entity.d.ts";
|
|
2
|
+
import { Action } from "./action.d.ts";
|
|
3
3
|
export type GameEntityBehaviorConstructor<RequiredState extends object = object> = new () => GameEntityBehavior<RequiredState>;
|
|
4
|
-
export interface GameEntityDefinition {
|
|
4
|
+
export interface GameEntityDefinition<State extends object = object> {
|
|
5
5
|
type: string;
|
|
6
|
-
defaultState: Record<string, any>;
|
|
7
|
-
behaviors: GameEntityBehaviorConstructor[];
|
|
8
6
|
actions?: Action[];
|
|
7
|
+
defaultState: State;
|
|
8
|
+
behaviors: GameEntityBehaviorConstructor[];
|
|
9
9
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EngineOptions, NullEngineOptions, WebGPUEngineOptions } from '@babylonjs/core';
|
|
2
|
-
import
|
|
3
|
-
import { BindingDefinition } from
|
|
2
|
+
import { LogLevel } from "./logger.d.ts";
|
|
3
|
+
import { BindingDefinition } from "./binding.d.ts";
|
|
4
4
|
export type GameCanvas = HTMLCanvasElement | OffscreenCanvas | null;
|
|
5
5
|
/** Specifies which rendering engine to force using */
|
|
6
6
|
export type EngineType = 'webgl' | 'webgpu' | 'auto';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { GameEventBus } from
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { LoggingUtility } from
|
|
1
|
+
import { GameEventBus } from "../classes/eventBus.d.ts";
|
|
2
|
+
import { Binding, BindingDefinition, Context } from "../interfaces/binding.d.ts";
|
|
3
|
+
import { InputDevice, InputState } from "../interfaces/input.d.ts";
|
|
4
|
+
import { Action } from "../interfaces/action.d.ts";
|
|
5
|
+
import { LoggingUtility } from "../utils/logger.d.ts";
|
|
6
6
|
/**
|
|
7
7
|
* Configuration object structure for binding manager
|
|
8
8
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { GameEntity } from
|
|
2
|
-
import { GameEventBus } from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { LoggingUtility } from
|
|
1
|
+
import { GameEntity } from "../classes/entity.d.ts";
|
|
2
|
+
import { GameEventBus } from "../classes/eventBus.d.ts";
|
|
3
|
+
import { GameEntityDefinition } from "../interfaces/entity.d.ts";
|
|
4
|
+
import { BindingManager } from "../managers/binding.d.ts";
|
|
5
|
+
import { LoggingUtility } from "../utils/logger.d.ts";
|
|
6
6
|
export declare class GameEntityManager {
|
|
7
7
|
/** The event bus for the entity manager. */
|
|
8
8
|
private eventBus;
|
|
@@ -27,12 +27,12 @@ export declare class GameEntityManager {
|
|
|
27
27
|
* @param newAction - The action being registered
|
|
28
28
|
* @returns true if the actions are compatible, false if they have conflicting options
|
|
29
29
|
*/
|
|
30
|
-
private
|
|
30
|
+
private _areActionsCompatible;
|
|
31
31
|
/**
|
|
32
32
|
* Registers actions defined in the entity definition with the binding manager
|
|
33
33
|
* @param entityDef - The entity definition containing actions to register
|
|
34
34
|
*/
|
|
35
|
-
private
|
|
35
|
+
private _registerEntityActions;
|
|
36
36
|
$frameUpdate(dt: number): void;
|
|
37
37
|
/**
|
|
38
38
|
* Registers a new entity definition.
|
package/dist/managers/game.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AbstractEngine } from '@babylonjs/core';
|
|
2
|
-
import { GameCanvas } from
|
|
3
|
-
import { GameEntityManager } from
|
|
4
|
-
import { UserInputManager } from
|
|
5
|
-
import { SceneEngine } from
|
|
6
|
-
import { LoggingUtility } from
|
|
2
|
+
import { GameCanvas } from "../interfaces/game.d.ts";
|
|
3
|
+
import { GameEntityManager } from "./entity.d.ts";
|
|
4
|
+
import { UserInputManager } from "./input.d.ts";
|
|
5
|
+
import { SceneEngine } from "../engines/scene.d.ts";
|
|
6
|
+
import { LoggingUtility } from "../utils/logger.d.ts";
|
|
7
7
|
export declare class GameManager {
|
|
8
8
|
private _engine;
|
|
9
9
|
private _entityManager;
|
package/dist/managers/input.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { GameEventBus } from
|
|
3
|
-
import { LoggingUtility } from
|
|
1
|
+
import { InputDevice } from "../interfaces/input.d.ts";
|
|
2
|
+
import { GameEventBus } from "../classes/eventBus.d.ts";
|
|
3
|
+
import { LoggingUtility } from "../utils/logger.d.ts";
|
|
4
4
|
/**
|
|
5
5
|
* Manager for handling user input from various devices (keyboard, mouse, gamepad)
|
|
6
6
|
*/
|
package/dist/managers/level.d.ts
CHANGED
package/dist/sage.d.ts
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { GameCanvas, RenderEngineOptions, SageOptions } from
|
|
2
|
-
import { SkewedAspectGameEngine } from
|
|
3
|
-
import { GameEventBus } from
|
|
1
|
+
import { GameCanvas, RenderEngineOptions, SageOptions } from "./interfaces/game.d.ts";
|
|
2
|
+
import { SkewedAspectGameEngine } from "./classes/gameEngine.d.ts";
|
|
3
|
+
import { GameEventBus } from "./classes/eventBus.d.ts";
|
|
4
|
+
import { GameEntityDefinition } from "./interfaces/entity.d.ts";
|
|
4
5
|
/**
|
|
5
6
|
* Creates an instance of SkewedAspectGameEngine.
|
|
6
7
|
* @param canvas - The game canvas.
|
|
8
|
+
* @param entities - The game entities.
|
|
7
9
|
* @param options - The game engine options including rendering options and log level.
|
|
8
10
|
* @returns A promise that resolves to an instance of SkewedAspectGameEngine.
|
|
9
11
|
*/
|
|
10
|
-
export declare function createGameEngine(canvas: GameCanvas, options?: SageOptions): Promise<SkewedAspectGameEngine>;
|
|
12
|
+
export declare function createGameEngine(canvas: GameCanvas, entities: GameEntityDefinition[], options?: SageOptions): Promise<SkewedAspectGameEngine>;
|
|
11
13
|
export type { GameCanvas, RenderEngineOptions, SageOptions };
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
14
|
+
export * from "./interfaces/action.d.ts";
|
|
15
|
+
export * from "./interfaces/binding.d.ts";
|
|
16
|
+
export * from "./interfaces/entity.d.ts";
|
|
17
|
+
export * from "./interfaces/game.d.ts";
|
|
18
|
+
export * from "./interfaces/input.d.ts";
|
|
19
|
+
export * from "./interfaces/logger.d.ts";
|
|
18
20
|
export { GameEventBus, SkewedAspectGameEngine };
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
21
|
+
export * from "./classes/eventBus.d.ts";
|
|
22
|
+
export * from "./classes/entity.d.ts";
|
|
23
|
+
export * from "./utils/logger.d.ts";
|
|
24
|
+
export * from "./utils/version.d.ts";
|