pub struct ArenaRoom {
pub room_type: RoomType,
pub bounds: AABB,
pub physics_objects: Vec<ObjectId>,
pub spawn_points: Vec<Vec2>,
pub exits: Vec<RoomExit>,
pub room_id: u32,
}Expand description
A room within the arena dungeon.
Fields§
§room_type: RoomType§bounds: AABB§physics_objects: Vec<ObjectId>§spawn_points: Vec<Vec2>§exits: Vec<RoomExit>§room_id: u32Implementations§
Source§impl ArenaRoom
impl ArenaRoom
pub fn new(room_id: u32, room_type: RoomType, bounds: AABB) -> Self
Sourcepub fn add_spawn_point(&mut self, point: Vec2)
pub fn add_spawn_point(&mut self, point: Vec2)
Add a spawn point.
Sourcepub fn register_object(&mut self, id: ObjectId)
pub fn register_object(&mut self, id: ObjectId)
Register a physics object as belonging to this room.
Sourcepub fn contains_point(&self, p: Vec2) -> bool
pub fn contains_point(&self, p: Vec2) -> bool
Check if a point is within room bounds.
Sourcepub fn dimensions(&self) -> Vec2
pub fn dimensions(&self) -> Vec2
Get room dimensions.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ArenaRoom
impl RefUnwindSafe for ArenaRoom
impl Send for ArenaRoom
impl Sync for ArenaRoom
impl Unpin for ArenaRoom
impl UnsafeUnpin for ArenaRoom
impl UnwindSafe for ArenaRoom
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.