Skip to content

Commit

Permalink
Uncomment example code.
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvallanger committed Nov 18, 2018
1 parent e9c13cf commit a201a53
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/storage/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@ use world::{Component, EntitiesRes};
/// something like this:
///
/// ```
/// # use specs::prelude::*;
/// #
/// # struct Pos; impl Component for Pos { type Storage = VecStorage<Self>; }
/// # struct Vel; impl Component for Vel { type Storage = VecStorage<Self>; }
/// #
/// # let mut world = World::new(); world.register::<Pos>(); world.register::<Vel>();
/// # let pos_storage = world.read_storage::<Pos>();
/// # let vel_storage = world.read_storage::<Vel>();
/// (&pos_storage, &vel_storage).join()
/// # ;
/// use specs::prelude::*;
///
/// struct Pos; impl Component for Pos { type Storage = VecStorage<Self>; }
/// struct Vel; impl Component for Vel { type Storage = VecStorage<Self>; }
///
/// let mut world = World::new(); world.register::<Pos>(); world.register::<Vel>();
/// let pos_storage = world.read_storage::<Pos>();
/// let vel_storage = world.read_storage::<Vel>();
///
/// for (pos, vel) in (&pos_storage, &vel_storage).join() {
/// }
/// ```
///
/// This joins the position and the velocity storage, which means it only
Expand Down

0 comments on commit a201a53

Please sign in to comment.