lyra-engine/lyra-ecs/src/lib.rs

79 lines
1.2 KiB
Rust
Raw Normal View History

2023-12-21 22:02:59 +00:00
extern crate self as lyra_ecs;
#[allow(unused_imports)]
pub(crate) mod lyra_engine {
pub(crate) mod ecs {
pub use super::super::*;
}
}
use std::ops::BitOr;
2024-03-03 01:20:38 +00:00
mod archetype;
pub use archetype::*;
2024-03-03 01:20:38 +00:00
mod entity;
pub use entity::*;
2024-03-03 01:20:38 +00:00
mod world;
pub use world::*;
2024-03-03 01:20:38 +00:00
mod command;
pub use command::*;
2024-03-03 01:20:38 +00:00
mod bundle;
pub use bundle::*;
2024-03-03 01:20:38 +00:00
mod component;
pub use component::*;
pub mod query;
//pub use query::*;
pub mod relation;
2024-03-03 01:20:38 +00:00
pub use relation::Relation;
mod component_info;
pub use component_info::*;
2024-03-03 01:20:38 +00:00
mod resource;
pub use resource::*;
pub mod system;
//pub use system::*;
2023-12-04 04:14:27 +00:00
2024-03-03 01:20:38 +00:00
mod tick;
2023-12-26 19:12:53 +00:00
pub use tick::*;
/// Implements Component for glam math types
#[cfg(feature = "math")]
pub mod math;
2023-12-21 22:02:59 +00:00
pub use lyra_ecs_derive::*;
pub use atomic_refcell::AtomicRef;
pub use atomic_refcell::AtomicRefMut;
#[cfg(test)]
2023-12-04 04:14:27 +00:00
mod tests;
#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub enum Access {
None,
2023-12-04 04:14:27 +00:00
Read,
Write,
}
impl BitOr for Access {
type Output = Access;
fn bitor(self, rhs: Self) -> Self::Output {
if self == Access::Write || rhs == Access::Write {
Access::Write
} else if self == Access::Read || rhs == Access::Read {
Access::Read
} else {
Access::None
}
}
2023-12-04 04:14:27 +00:00
}