pub struct OatsSystem { /* private fields */ }Expand description
Core OATS system that orchestrates all components
Implementations§
Source§impl OatsSystem
impl OatsSystem
Sourcepub fn with_capacity(objects: usize, actions: usize, systems: usize) -> Self
pub fn with_capacity(objects: usize, actions: usize, systems: usize) -> Self
Create a new OATS system with pre-allocated capacity
Sourcepub fn add_object(&mut self, object: Object)
pub fn add_object(&mut self, object: Object)
Add an object to the system
Sourcepub fn add_objects(&mut self, objects: impl IntoIterator<Item = Object>)
pub fn add_objects(&mut self, objects: impl IntoIterator<Item = Object>)
Add multiple objects efficiently
Sourcepub fn add_action(&mut self, action: Box<dyn Action>)
pub fn add_action(&mut self, action: Box<dyn Action>)
Add an action to the system
Sourcepub fn add_system(&mut self, system: Box<dyn System>)
pub fn add_system(&mut self, system: Box<dyn System>)
Add a system to the system
Sourcepub fn object_count(&self) -> usize
pub fn object_count(&self) -> usize
Get object count
Sourcepub fn action_count(&self) -> usize
pub fn action_count(&self) -> usize
Get action count
Sourcepub fn system_count(&self) -> usize
pub fn system_count(&self) -> usize
Get system count
Sourcepub fn clear_objects(&mut self)
pub fn clear_objects(&mut self)
Clear all objects
Sourcepub fn clear_actions(&mut self)
pub fn clear_actions(&mut self)
Clear all actions
Sourcepub fn clear_systems(&mut self)
pub fn clear_systems(&mut self)
Clear all systems
Sourcepub fn reserve_objects(&mut self, additional: usize)
pub fn reserve_objects(&mut self, additional: usize)
Reserve capacity for objects
Sourcepub fn reserve_actions(&mut self, additional: usize)
pub fn reserve_actions(&mut self, additional: usize)
Reserve capacity for actions
Sourcepub fn reserve_systems(&mut self, additional: usize)
pub fn reserve_systems(&mut self, additional: usize)
Reserve capacity for systems
Trait Implementations§
Source§impl Default for OatsSystem
impl Default for OatsSystem
Source§fn default() -> OatsSystem
fn default() -> OatsSystem
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OatsSystem
impl !RefUnwindSafe for OatsSystem
impl Send for OatsSystem
impl Sync for OatsSystem
impl Unpin for OatsSystem
impl !UnwindSafe for OatsSystem
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