Struct mold2d::actor_manager::ActorManager
[−]
[src]
pub struct ActorManager<Type, Message> { pub actors: HashMap<i32, Box<Actor<Type, Message>>>, // some fields omitted }
Manages all the actors for the game by hashing actors by id
Fields
actors: HashMap<i32, Box<Actor<Type, Message>>>
Methods
impl<Type, Message> ActorManager<Type, Message>
[src]
fn new(actor_gen: ActorFromToken<Type, Message>) -> ActorManager<Type, Message>
fn add(&mut self, token: char, position: (i32, i32), renderer: &mut Renderer)
Add a new actor into the manager
fn remove(&mut self, id: i32)
Remove an actor from the actors
fn temp_remove(&mut self, id: i32) -> Option<Box<Actor<Type, Message>>>
Temporarily remove an actor to appease borrow checker
fn get_mut(&mut self, id: i32) -> Option<&mut Box<Actor<Type, Message>>>
Get a mutable reference to an actor given the id
fn temp_reinsert(&mut self, id: i32, actor: Box<Actor<Type, Message>>)
Reinsert a temporarily removed actor