@arcade2d/world
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -23,2 +23,2 @@ import { Value as JSONValue } from 'json-typescript'; | ||
export declare type ComponentFactory<T> = (owner: T) => readonly Component<T>[]; | ||
export declare type ComponentConstructor<T = any> = new (owner: T, ...args: readonly unknown[]) => Component<T>; | ||
export declare type ComponentConstructor<T = any> = new (owner: T, ...args: readonly any[]) => Component<T>; |
@@ -10,3 +10,3 @@ import { Component, ComponentConstructor, ComponentFactory } from './component'; | ||
*/ | ||
getComponent<C extends Component<T>>(type: new (owner: T, ...args: readonly unknown[]) => C): C; | ||
getComponent<C extends Component<T>>(type: new (owner: T, ...args: readonly any[]) => C | null): C; | ||
/** | ||
@@ -13,0 +13,0 @@ * Adds a new component to this object. |
@@ -17,7 +17,4 @@ "use strict"; | ||
getComponent(type) { | ||
const component = this.components.get(type); | ||
if (!component) { | ||
throw new Error(`Provider ${this} does not have a component of type ${type.name}.`); | ||
} | ||
return component; | ||
var _a; | ||
return (_a = this.components.get(type)) !== null && _a !== void 0 ? _a : null; | ||
} | ||
@@ -24,0 +21,0 @@ /** |
{ | ||
"name": "@arcade2d/world", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Provides components for composing and running a game world.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -5,3 +5,3 @@ # @arcade2d/world | ||
[Repository](https://gitlab.com/arcade2d/world) · [Website](https://arcade2d.com) | ||
[Repository](https://gitlab.com/arcade2d/world) · [Website](https://arcade2d.com) · [Reference](https://arcade2d.gitlab.io/world/) | ||
@@ -8,0 +8,0 @@ The aim of this library is to construct and simulate a game world in an abstract sense. It does not provide any functionality or features outside of this such as rendering capabilities (graphics), sound or other game related components. It purely focuses on a game world and how objects within that world can be interacted with and interact with each other. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43021
1244