mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-25 01:20:04 +00:00
Out with the old
This commit is contained in:
parent
8d1879c3bb
commit
04fefa7988
4 changed files with 0 additions and 251 deletions
|
@ -1,45 +0,0 @@
|
|||
# World
|
||||
|
||||
A World contains all ECS data
|
||||
Games can have multiple worlds, although typically only one is necessary. These worlds are isolated from each other, meaning they donot share the same entities nor component IDs.
|
||||
|
||||
---
|
||||
|
||||
# Entity
|
||||
|
||||
An unique id.
|
||||
|
||||
Entities consist out of a number unique to the entity in the lower 32 bits, and a counter used to track entity liveliness in the upper 32 bits. When an id is recycled, its generation count is increased. This causes recycled ids to be very large (>4 billion), which is normal.
|
||||
|
||||
---
|
||||
|
||||
# QueryIter
|
||||
|
||||
A result from the `World:query` function.
|
||||
|
||||
Queries are used to iterate over entities that match against the set collection of components.
|
||||
|
||||
Calling it in a loop will allow iteration over the results.
|
||||
|
||||
```lua
|
||||
for id, enemy, charge, model in world:query(Enemy, Charge, Model) do
|
||||
-- Do something
|
||||
end
|
||||
```
|
||||
|
||||
### QueryIter.without
|
||||
|
||||
QueryIter.without(iter: QueryIter
|
||||
...: [Entity](#Entity)): QueryIter
|
||||
|
||||
|
||||
Create a new Query Iterator from the filter
|
||||
|
||||
#### Parameters
|
||||
world The world.
|
||||
... The collection of components to filter archetypes against.
|
||||
|
||||
#### Returns
|
||||
|
||||
The new query iterator.
|
||||
|
|
@ -1,187 +0,0 @@
|
|||
# World
|
||||
|
||||
### World.new
|
||||
|
||||
World.new(): [World](../api-types.md#World)
|
||||
|
||||
Create a new world.
|
||||
|
||||
#### Returns
|
||||
A new world
|
||||
|
||||
---
|
||||
|
||||
### World.entity
|
||||
|
||||
World.entity(world: [World](../api-types.md#World)): [Entity](../api-types.md#Entity)
|
||||
|
||||
Creates an entity in the world.
|
||||
|
||||
#### Returns
|
||||
A new entiity id
|
||||
|
||||
---
|
||||
|
||||
### World.target
|
||||
|
||||
World.target(world: [World](../api-types.md#World),
|
||||
entity: [Entity](../api-types.md#Entity),
|
||||
rel: [Entity](../api-types.md#Entity)): [Entity](../api-types.md#Entity)
|
||||
|
||||
Get the target of a relationship.
|
||||
|
||||
This will return a target (second element of a pair) of the entity for the specified relationship.
|
||||
|
||||
#### Parameters
|
||||
world The world.
|
||||
entity The entity.
|
||||
rel The relationship between the entity and the target.
|
||||
|
||||
#### Returns
|
||||
|
||||
The first target for the relationship
|
||||
|
||||
---
|
||||
|
||||
### World.add
|
||||
|
||||
World.add(world: [World](../api-types.md#World),
|
||||
entity: [Entity](../api-types.md#Entity),
|
||||
id: [Entity](../api-types.md#Entity)): [Entity](..#api-types.md#Entity)
|
||||
|
||||
Add a (component) id to an entity.
|
||||
|
||||
This operation adds a single (component) id to an entity.
|
||||
If the entity already has the id, this operation will have no side effects.
|
||||
|
||||
#### Parameters
|
||||
world The world.
|
||||
entity The entity.
|
||||
id The id to add.
|
||||
|
||||
---
|
||||
|
||||
### World.remove
|
||||
|
||||
World.remove(world: [World](../api-types#World),
|
||||
entity: [Entity](../api-types#Entity),
|
||||
id: [Entity](../api-types#Entity)): [Entity](../api-types#Entity)
|
||||
|
||||
Remove a (component) id to an entity.
|
||||
|
||||
This operation removes a single (component) id to an entity.
|
||||
If the entity already has the id, this operation will have no side effects.
|
||||
|
||||
#### Parameters
|
||||
world The world.
|
||||
entity The entity.
|
||||
id The id to add.
|
||||
|
||||
---
|
||||
|
||||
### World.get
|
||||
|
||||
World.get(world: [World](../api-types.md#World),
|
||||
entity: [Entity](../api-types.md#Entity),
|
||||
id: [Entity](../api-types.md#Entity)): any
|
||||
|
||||
Gets the component data.
|
||||
|
||||
#### Parameters
|
||||
world The world.
|
||||
entity The entity.
|
||||
id The id of component to get.
|
||||
|
||||
#### Returns
|
||||
The component data, nil if the entity does not have the componnet.
|
||||
|
||||
---
|
||||
|
||||
### World.set
|
||||
|
||||
World.set(world: [World](../api-types.md#World),
|
||||
entity: [Entity](../api-types.md#Entity),
|
||||
id: [Entity](../api-types.md#Entity)
|
||||
data: any)
|
||||
|
||||
Set the value of a component.
|
||||
|
||||
#### Parameters
|
||||
world The world.
|
||||
entity The entity.
|
||||
id The id of the componment set.
|
||||
data The data to the component.
|
||||
|
||||
---
|
||||
|
||||
### World.query
|
||||
|
||||
World.query(world: [World](../api-types.md#World),
|
||||
...: [Entity](../api-types.mdEntity)): [QueryIter](../api-types.md#QueryIter)
|
||||
|
||||
Create a QueryIter from the list of filters.
|
||||
|
||||
#### Parameters
|
||||
world The world.
|
||||
... The collection of components to match entities against.
|
||||
|
||||
#### Returns
|
||||
|
||||
The query iterator.
|
||||
|
||||
---
|
||||
|
||||
# Pair
|
||||
|
||||
### pair
|
||||
|
||||
pair(first: [Entity](../api-types#Entity), second: [Entity](../api-types#Entity)): [Entity](../api-types#Entity)
|
||||
|
||||
Creates a composite key.
|
||||
|
||||
#### Parameters
|
||||
first The first element.
|
||||
second The second element.
|
||||
|
||||
#### Returns
|
||||
|
||||
The pair of the two elements
|
||||
|
||||
---
|
||||
|
||||
### IS_PAIR
|
||||
|
||||
jecs.IS_PAIR(id: [Entity](../api-types#Entity)): boolean
|
||||
|
||||
Creates a composite key.
|
||||
|
||||
#### Parameters
|
||||
id The id to check.
|
||||
|
||||
#### Returns
|
||||
|
||||
If id is a pair.
|
||||
|
||||
---
|
||||
|
||||
# Constants
|
||||
|
||||
### OnAdd
|
||||
|
||||
---
|
||||
|
||||
### OnRemove
|
||||
|
||||
---
|
||||
|
||||
### Rest
|
||||
|
||||
---
|
||||
|
||||
### OnSet
|
||||
|
||||
---
|
||||
|
||||
### Wildcard
|
||||
|
||||
Matches any id, returns all matches.
|
|
@ -1,19 +0,0 @@
|
|||
# Getting Started
|
||||
This section will provide a walk through setting up your development environment and a quick overview of the different features and concepts in Jecs with short examples.
|
||||
|
||||
## Installing Jecs
|
||||
|
||||
To use Jecs, you will need to add the library to your project's source folder.
|
||||
|
||||
## Installing as standalone
|
||||
Head over to the [Releases](https://github.com/ukendio/jecs/releases/latest) page and install the rbxm file.
|
||||

|
||||
|
||||
## Installing with Wally
|
||||
Jecs is available as a package on [wally.run](https://wally.run/package/ukendio/jecs)
|
||||
|
||||
Add it to your project's Wally.toml like this:
|
||||
```toml
|
||||
[dependencies]
|
||||
jecs = "0.1.0" # Make sure this is the latest version
|
||||
```
|
Binary file not shown.
Before Width: | Height: | Size: 34 KiB |
Loading…
Reference in a new issue