From 2cefae15729bb7bd1bcc79e857efcd5c6db5b3c3 Mon Sep 17 00:00:00 2001 From: "Claas j. Gramann" Date: Tue, 23 Apr 2024 08:23:45 +0200 Subject: [PATCH] Add example for #733 --- docs/tutorials/src/02_hello_world.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/tutorials/src/02_hello_world.md b/docs/tutorials/src/02_hello_world.md index d27864d12..90a776d02 100644 --- a/docs/tutorials/src/02_hello_world.md +++ b/docs/tutorials/src/02_hello_world.md @@ -84,10 +84,25 @@ struct Velocity { If the `#[storage(...)]` attribute is omitted, the given component will be stored in a `DenseVecStorage` by default. But for this example, we are explicitly asking for these components to be kept in a `VecStorage` instead (see -the later [storages chapter][sc] for more details). But before we move on, we +the later [storages chapter][sc] for more details). + +`#[storage(VecStorage)]` assumes `` as the default type parameter for the storage. +More complex type parameters can be specified explicitly: + +```rust,ignore +#[derive(Component, Debug)] +#[storage(FlaggedStorage>)] +pub struct Data { + [..] +} +``` +(see the later [`FlaggedStorage` and modification events chapter][tc] for more details on `FlaggedStorage`) + +But before we move on, we need to create a world in which to store all of our components. [sc]: ./05_storages.html +[tc]: ./12_tracked.html ## The `World`