Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubpa committed Aug 1, 2020
1 parent 78a73b5 commit bfd0068
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 2 additions & 0 deletions doc/API.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# API

> maybe outmoded, it's better to read [source codes](../include/UECS) directly
## `Entity`

Entity = `index` + `version`
Expand Down
21 changes: 13 additions & 8 deletions doc/comparison.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use `schedule.Order(<system-name>, <system-name>)` to set system update order

**Creating entities**

(TODO) copy
copy -> `instantiate`

(TODO) batch create

Expand Down Expand Up @@ -65,19 +65,19 @@ needless, you can use components constructor, destructor and move comstructor (c

### 2.4 Dynamic buffer components

needless, you can use any type (e.g. `std::vector`) in Component
needless, you can use any type (e.g. `std::vector`) in your component

### 2.5 Chunk components

(TODO)

## 3. Systems

no instantiation, just use static function `OnUpdate(Schedule&)`,you can register `SystemFunc`,set update order, dynamic change filter, etc.
like Unity3D

### 3.1 Creating systems

lifecycle: only support `OnUpdate`, because of no instantiation
lifecycle: support `OnUpdate`, you can C++'s constructor and desturctor

(TODO) shared component filter

Expand All @@ -89,20 +89,21 @@ use `CmptTag::LastFrame<Cmpt> (like const <Cmpt>*)`, `CmptTag::Write<Cmpt> == <C

- `SystemFunc` with `LastFrame<Cmpt>` run before any `SystemFunc` with `CmptTag::Write<Cmpt>`

- `SystemFunc` with `CmptTag::Write<Cmpt>` run before any `SystemFunc` with `CmptTag::Lastest<Cmpt>`
- `SystemFunc` with `Write<Cmpt>` run before any `SystemFunc` with `CmptTag::Lastest<Cmpt>`

**special parameters**

- `[const] Entity`
- `size_t entityInQueryIndex`
- (not-support) `size_t nativeThreadIndex`
- `RTDCmptViewer`
- `ChunkView`

**System kind**

- components (optional: + `Entity`, `size_t entityInQueryIndex`) : system for each entity
- components (optional: `Entity`, `size_t entityInQueryIndex`, `RTDCmptViewer`) : system for each entity
- empty : job
- `RTDCmptViewer`: run-time dynamic system function
- chunk: `ChunkView`

### 3.2 System update order

Expand All @@ -114,18 +115,22 @@ use `CmptTag::LastFrame<Cmpt> (like const <Cmpt>*)`, `CmptTag::Write<Cmpt> == <C

### 3.5 Entity command buffers

`World::AddCommand()`,run all commands after Update Graph
`World::AddCommand()`,run all commands after Update graph

## 4. Sync points and structural changes

(TODO)

currently, UECS only has a sync point `World::AddCommand()`

you can use a job as a syncpoint

## 5. Component WriteGroups

use `Schedule::{Insert|Erase}{All|Any|None}` to dynamic change a system's filter

Unity's `WriteGroup`

## 6. Versions and generations

only support `Entity::Version`
Expand Down

0 comments on commit bfd0068

Please sign in to comment.