Skip to content

Commit

Permalink
Add HashMapStorage imports to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Aceeri committed Dec 23, 2017
1 parent cbf3586 commit 045b031
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions benches/parallel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
extern crate cgmath;
extern crate rand;
extern crate specs;
extern crate shred;
extern crate test;

use cgmath::Vector2;
use rand::thread_rng;
use specs::prelude::*;
use specs::storage::{HashMapStorage, NullStorage};
use shred::RunningTime;
use test::Bencher;

type Vec2 = Vector2<f32>;
Expand Down
1 change: 1 addition & 0 deletions benches/world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ extern crate specs;
extern crate test;

use specs::prelude::*;
use specs::storage::HashMapStorage;

#[derive(Clone, Debug)]
struct CompInt(i32);
Expand Down
1 change: 1 addition & 0 deletions examples/cluster_bomb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use rand::distributions::{IndependentSample, Range};
use rayon::iter::ParallelIterator;

use specs::prelude::*;
use specs::storage::HashMapStorage;

const TAU: f32 = 2. * std::f32::consts::PI;

Expand Down
1 change: 1 addition & 0 deletions examples/full.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ extern crate shred_derive;
extern crate specs;

use specs::prelude::*;
use specs::storage::HashMapStorage;

// -- Components --
// A component exists for 0..n
Expand Down
5 changes: 3 additions & 2 deletions src/join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use rayon::iter::ParallelIterator;
use rayon::iter::internal::{bridge_unindexed, Folder, UnindexedConsumer, UnindexedProducer};
use tuple_utils::Split;

use world::{Entity, Index};
use world::{Entities, Entity, Index};

/// `BitAnd` is a helper method to & bitsets together resulting in a tree.
pub trait BitAnd {
Expand Down Expand Up @@ -73,6 +73,7 @@ bitset_and!{A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P}
///
/// ```
/// # use specs::prelude::*;
/// # use specs::world::EntitiesRes;
/// # #[derive(Debug, PartialEq)]
/// # struct Pos; impl Component for Pos { type Storage = VecStorage<Self>; }
/// # #[derive(Debug, PartialEq)]
Expand Down Expand Up @@ -196,7 +197,7 @@ impl<J: Join> JoinIter<J> {
/// ## Example
///
/// ```
/// # use specs::*;
/// # use specs::prelude::*;
/// # #[derive(Debug, PartialEq)]
/// # struct Pos; impl Component for Pos { type Storage = VecStorage<Self>; }
/// # #[derive(Debug, PartialEq)]
Expand Down
1 change: 0 additions & 1 deletion src/storage/flagged.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ where

unsafe fn insert(&mut self, id: Index, comp: C) {
self.inserted.single_write(Flag::Flag(id).into());
self.modified.single_write(Flag::Flag(id).into());
self.storage.insert(id, comp);
}

Expand Down
1 change: 1 addition & 0 deletions src/world/comp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ use storage::UnprotectedStorage;
///
/// ```
/// use specs::prelude::*;
/// use specs::storage::HashMapStorage;
///
/// pub struct Camera {
/// // In an ECS, the camera would not itself have a position;
Expand Down
1 change: 1 addition & 0 deletions src/world/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ impl<'a> Iterator for CreateIter<'a> {
///
/// ```
/// use specs::prelude::*;
/// use specs::storage::HashMapStorage;
///
/// struct Health(f32);
///
Expand Down
2 changes: 1 addition & 1 deletion tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extern crate rayon;
extern crate specs;

use specs::prelude::*;
use specs::storage::InsertResult;
use specs::storage::{HashMapStorage, InsertResult};

#[derive(Clone, Debug, PartialEq)]
struct CompInt(i8);
Expand Down

0 comments on commit 045b031

Please sign in to comment.