mirror of
https://github.com/BlackMATov/evolved.lua.git
synced 2025-12-13 11:38:15 +07:00
simple api reference
This commit is contained in:
33
README.md
33
README.md
@@ -2,8 +2,39 @@
|
|||||||
|
|
||||||
## API Reference
|
## API Reference
|
||||||
|
|
||||||
|
### Module `registry`
|
||||||
|
|
||||||
```
|
```
|
||||||
coming soon...
|
registry.entity -> (entity)
|
||||||
|
registry.is_alive -> entity -> (boolean)
|
||||||
|
registry.destroy -> entity -> ()
|
||||||
|
registry.get -> entity -> entity -> (any)
|
||||||
|
registry.get_or -> entity -> entity -> any -> (any)
|
||||||
|
registry.has -> entity -> entity -> (boolean)
|
||||||
|
registry.has_all -> entity -> entity -> entity... -> (boolean)
|
||||||
|
registry.has_any -> entity -> entity -> entity... -> (boolean)
|
||||||
|
registry.assign -> entity -> entity -> any -> ()
|
||||||
|
registry.insert -> entity -> entity -> any -> ()
|
||||||
|
registry.remove -> entity -> entity -> ()
|
||||||
|
registry.query -> entity -> entity... -> (query)
|
||||||
|
registry.execute -> query -> (() -> (chunk?))
|
||||||
|
registry.chunk -> entity -> entity... -> (chunk)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Module `singles`
|
||||||
|
|
||||||
|
```
|
||||||
|
singles.single -> any -> (entity)
|
||||||
|
singles.get -> entity -> (any)
|
||||||
|
singles.has -> entity -> (boolean)
|
||||||
|
singles.assign -> entity -> any -> ()
|
||||||
|
```
|
||||||
|
|
||||||
|
### Module `vectors`
|
||||||
|
|
||||||
|
```
|
||||||
|
vectors.vector2 -> number -> number -> (vector2)
|
||||||
|
vectors.is_vector2 -> any -> (boolean)
|
||||||
```
|
```
|
||||||
|
|
||||||
## [License (MIT)](./LICENSE.md)
|
## [License (MIT)](./LICENSE.md)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
## Backlog
|
## Backlog
|
||||||
|
|
||||||
|
- add oop-like api for entities and queries
|
||||||
- cache matched chunks in queries
|
- cache matched chunks in queries
|
||||||
- cache transitions between chunks
|
- cache transitions between chunks
|
||||||
- chunk's children should be sorted by id and stored in an array instead of a table
|
- chunk's children should be sorted by id and stored in an array instead of a table
|
||||||
@@ -471,12 +471,6 @@ function registry.execute(query)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
---
|
|
||||||
---
|
|
||||||
---
|
|
||||||
---
|
|
||||||
---
|
|
||||||
|
|
||||||
---@param fragment evolved.entity
|
---@param fragment evolved.entity
|
||||||
---@param ... evolved.entity
|
---@param ... evolved.entity
|
||||||
---@return evolved.chunk
|
---@return evolved.chunk
|
||||||
|
|||||||
Reference in New Issue
Block a user