picking + entity names
This commit is contained in:
12
src/world.rs
12
src/world.rs
@@ -2,11 +2,11 @@ use std::collections::HashMap;
|
||||
|
||||
use crate::components::dissolve::DissolveComponent;
|
||||
use crate::components::follow::FollowComponent;
|
||||
use crate::components::jump::JumpComponent;
|
||||
use crate::components::lights::spot::SpotlightComponent;
|
||||
use crate::components::tree_instances::TreeInstancesComponent;
|
||||
use crate::components::{
|
||||
CameraComponent, InputComponent, MeshComponent, MovementComponent, PhysicsComponent,
|
||||
RotateComponent,
|
||||
CameraComponent, InputComponent, JumpComponent, MeshComponent, MovementComponent,
|
||||
PhysicsComponent, RotateComponent,
|
||||
};
|
||||
use crate::entity::{EntityHandle, EntityManager};
|
||||
use crate::state::StateMachine;
|
||||
@@ -84,6 +84,8 @@ pub struct World
|
||||
pub dissolves: Storage<DissolveComponent>,
|
||||
pub follows: Storage<FollowComponent>,
|
||||
pub rotates: Storage<RotateComponent>,
|
||||
pub tree_instances: Storage<TreeInstancesComponent>,
|
||||
pub names: Storage<String>,
|
||||
}
|
||||
|
||||
impl World
|
||||
@@ -106,6 +108,8 @@ impl World
|
||||
dissolves: Storage::new(),
|
||||
follows: Storage::new(),
|
||||
rotates: Storage::new(),
|
||||
tree_instances: Storage::new(),
|
||||
names: Storage::new(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,6 +134,8 @@ impl World
|
||||
self.dissolves.remove(entity);
|
||||
self.follows.remove(entity);
|
||||
self.rotates.remove(entity);
|
||||
self.tree_instances.remove(entity);
|
||||
self.names.remove(entity);
|
||||
self.entities.despawn(entity);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user