Search
Preparing search index...
The search index is not available
@jahed/ts-ecs
Options
All
Public
Public/Protected
All
Inherited
Externals
Menu
@jahed/ts-ecs
Index
Type aliases
Component
Component
Template
ECS
Engine
Entity
Entity
Manager
Milliseconds
Space
System
System
Manager
Task
Tasks
Functions
create
Component
create
Engine
create
Entity
create
Space
create
System
define
Component
Type aliases
Component
Component<T>
:
{
data
:
T
;
type
:
Readonly
<
string
>
}
Type parameters
T =
any
Type declaration
data
:
T
type
:
Readonly
<
string
>
Component
Template
Component
Template<T, P>
:
(
props
:
P
)
=>
T
&
{
type
:
string
}
Type parameters
T
P =
any
ECS
ECS
:
EntityManager
&
SystemManager
Engine
Engine
:
ECS
&
{
update
:
(
elapsedMS
:
Milliseconds
)
=>
void
}
Entity
Entity
:
{
addComponent
:
<T>
(
component
:
Component
<
T
>
)
=>
Entity
;
components
:
Map
<
string
,
Component
>
;
getComponent
:
<T, P>
(
template
:
ComponentTemplate
<
T
,
P
>
)
=>
Component
<
T
>
;
hasComponent
:
<T, P>
(
template
:
ComponentTemplate
<
T
,
P
>
)
=>
boolean
;
id
:
Readonly
<
string
>
}
Type declaration
add
Component
:
<T>
(
component
:
Component
<
T
>
)
=>
Entity
deprecated
Only use for building entities. Not in game loop.
<T>
(
component
:
Component
<
T
>
)
:
Entity
Type parameters
T
Parameters
component:
Component
<
T
>
Returns
Entity
components
:
Map
<
string
,
Component
>
get
Component
:
<T, P>
(
template
:
ComponentTemplate
<
T
,
P
>
)
=>
Component
<
T
>
<T, P>
(
template
:
ComponentTemplate
<
T
,
P
>
)
:
Component
<
T
>
Type parameters
T
P =
any
Parameters
template:
ComponentTemplate
<
T
,
P
>
Returns
Component
<
T
>
has
Component
:
<T, P>
(
template
:
ComponentTemplate
<
T
,
P
>
)
=>
boolean
<T, P>
(
template
:
ComponentTemplate
<
T
,
P
>
)
:
boolean
Type parameters
T
P =
unknown
Parameters
template:
ComponentTemplate
<
T
,
P
>
Returns
boolean
id
:
Readonly
<
string
>
Entity
Manager
Entity
Manager
:
{
addComponent
:
<T>
(
entity
:
Entity
, component
:
Component
<
T
>
)
=>
void
;
addEntities
:
(
...
entities
:
Entity
[]
)
=>
void
;
addEntity
:
(
entity
:
Entity
)
=>
void
;
entities
:
Map
<
string
,
Entity
>
;
getEntities
:
(
...
type
:
ComponentTemplate
<
any
>
[]
)
=>
Entity
[]
;
getEntity
:
(
...
type
:
ComponentTemplate
<
any
>
[]
)
=>
Entity
;
getEntityById
:
(
id
:
string
)
=>
Entity
;
removeComponent
:
<T, P>
(
entity
:
Entity
, component
:
Component
<
T
>
|
ComponentTemplate
<
T
,
P
>
)
=>
void
;
removeEntity
:
(
entity
:
Entity
|
string
)
=>
void
;
runTasks
:
(
)
=>
void
}
Type declaration
add
Component
:
<T>
(
entity
:
Entity
, component
:
Component
<
T
>
)
=>
void
<T>
(
entity
:
Entity
, component
:
Component
<
T
>
)
:
void
Type parameters
T
Parameters
entity:
Entity
component:
Component
<
T
>
Returns
void
add
Entities
:
(
...
entities
:
Entity
[]
)
=>
void
(
...
entities
:
Entity
[]
)
:
void
Parameters
Rest
...
entities:
Entity
[]
Returns
void
add
Entity
:
(
entity
:
Entity
)
=>
void
(
entity
:
Entity
)
:
void
Parameters
entity:
Entity
Returns
void
entities
:
Map
<
string
,
Entity
>
get
Entities
:
(
...
type
:
ComponentTemplate
<
any
>
[]
)
=>
Entity
[]
(
...
type
:
ComponentTemplate
<
any
>
[]
)
:
Entity
[]
Parameters
Rest
...
type:
ComponentTemplate
<
any
>
[]
Returns
Entity
[]
get
Entity
:
(
...
type
:
ComponentTemplate
<
any
>
[]
)
=>
Entity
(
...
type
:
ComponentTemplate
<
any
>
[]
)
:
Entity
Parameters
Rest
...
type:
ComponentTemplate
<
any
>
[]
Returns
Entity
get
Entity
ById
:
(
id
:
string
)
=>
Entity
(
id
:
string
)
:
Entity
Parameters
id:
string
Returns
Entity
remove
Component
:
<T, P>
(
entity
:
Entity
, component
:
Component
<
T
>
|
ComponentTemplate
<
T
,
P
>
)
=>
void
<T, P>
(
entity
:
Entity
, component
:
Component
<
T
>
|
ComponentTemplate
<
T
,
P
>
)
:
void
Type parameters
T
P =
any
Parameters
entity:
Entity
component:
Component
<
T
>
|
ComponentTemplate
<
T
,
P
>
Returns
void
remove
Entity
:
(
entity
:
Entity
|
string
)
=>
void
(
entity
:
Entity
|
string
)
:
void
Parameters
entity:
Entity
|
string
Returns
void
run
Tasks
:
(
)
=>
void
(
)
:
void
Returns
void
Milliseconds
Milliseconds
:
number
Space
Space
:
System
&
ECS
System
System
:
{
added
:
(
ecs
:
ECS
)
=>
void
;
disabled
:
(
ecs
:
ECS
)
=>
void
;
enabled
:
(
ecs
:
ECS
)
=>
void
;
id
:
Readonly
<
string
>
;
removed
:
(
ecs
:
ECS
)
=>
void
;
update
:
(
ecs
:
ECS
, elapsedMS
:
Milliseconds
)
=>
void
}
Type declaration
added
:
(
ecs
:
ECS
)
=>
void
(
ecs
:
ECS
)
:
void
Parameters
ecs:
ECS
Returns
void
disabled
:
(
ecs
:
ECS
)
=>
void
(
ecs
:
ECS
)
:
void
Parameters
ecs:
ECS
Returns
void
enabled
:
(
ecs
:
ECS
)
=>
void
(
ecs
:
ECS
)
:
void
Parameters
ecs:
ECS
Returns
void
id
:
Readonly
<
string
>
removed
:
(
ecs
:
ECS
)
=>
void
(
ecs
:
ECS
)
:
void
Parameters
ecs:
ECS
Returns
void
update
:
(
ecs
:
ECS
, elapsedMS
:
Milliseconds
)
=>
void
(
ecs
:
ECS
, elapsedMS
:
Milliseconds
)
:
void
Parameters
ecs:
ECS
elapsedMS:
Milliseconds
Returns
void
System
Manager
System
Manager
:
{
addSystem
:
(
system
:
System
)
=>
void
;
disableSystem
:
(
system
:
System
|
string
)
=>
void
;
enableSystem
:
(
system
:
System
|
string
)
=>
void
;
enabledSystems
:
Map
<
string
,
System
>
;
removeSystem
:
(
system
:
System
|
string
)
=>
void
;
runTasks
:
(
)
=>
void
;
systems
:
Map
<
string
,
System
>
}
Type declaration
add
System
:
(
system
:
System
)
=>
void
(
system
:
System
)
:
void
Parameters
system:
System
Returns
void
disable
System
:
(
system
:
System
|
string
)
=>
void
(
system
:
System
|
string
)
:
void
Parameters
system:
System
|
string
Returns
void
enable
System
:
(
system
:
System
|
string
)
=>
void
(
system
:
System
|
string
)
:
void
Parameters
system:
System
|
string
Returns
void
enabled
Systems
:
Map
<
string
,
System
>
remove
System
:
(
system
:
System
|
string
)
=>
void
(
system
:
System
|
string
)
:
void
Parameters
system:
System
|
string
Returns
void
run
Tasks
:
(
)
=>
void
(
)
:
void
Returns
void
systems
:
Map
<
string
,
System
>
Task
Task
:
(
)
=>
void
Type declaration
(
)
:
void
Returns
void
Tasks
Tasks
:
Map
<
string
,
Task
>
Functions
Const
create
Component
create
Component<T, P>
(
template
:
ComponentTemplate
<
T
,
P
>
, props
:
P
)
:
Component
<
T
>
Type parameters
T
P
Parameters
template:
ComponentTemplate
<
T
,
P
>
props:
P
Returns
Component
<
T
>
Const
create
Engine
create
Engine
(
)
:
Engine
Returns
Engine
Const
create
Entity
create
Entity
(
idTemplate
:
string
)
:
Entity
Parameters
idTemplate:
string
Returns
Entity
Const
create
Space
create
Space
(
__namedParameters
:
CreateSpaceArgs
)
:
Space
Parameters
__namedParameters:
CreateSpaceArgs
Returns
Space
Const
create
System
create
System
(
__namedParameters
:
CreateSystemArgs
)
:
System
Parameters
__namedParameters:
CreateSystemArgs
Returns
System
Const
define
Component
define
Component<T, P>
(
type
:
string
, factory
:
(
props
:
P
)
=>
T
)
:
ComponentTemplate
<
T
,
P
>
Type parameters
T
P =
undefined
Parameters
type:
string
factory:
(
props
:
P
)
=>
T
(
props
:
P
)
:
T
Parameters
props:
P
Returns
T
Returns
ComponentTemplate
<
T
,
P
>
Exports
Component
Component
Template
ECS
Engine
Entity
Entity
Manager
Milliseconds
Space
System
System
Manager
Task
Tasks
create
Component
create
Engine
create
Entity
create
Space
create
System
define
Component
Generated using
TypeDoc
Only use for building entities. Not in game loop.