Expand description
Cougr is a monolithic-on-the-outside ECS framework for Soroban-compatible applications.
The public API is intentionally split into:
- root re-exports for the onboarding path
appfor the default gameplay runtime surfaceauthfor beta account and session flowsprivacyfor stable and experimental privacy surfacesopsfor stable operational standardsaccountsfor account abstraction and session flowszk::stablefor stable privacy primitiveszk::experimentalfor fast-moving proof-verification APIs
§Golden Path
use cougr_core::{ComponentTrait, Position, SimpleWorld};
use soroban_sdk::Env;
let env = Env::default();
let mut world = SimpleWorld::new(&env);
let entity = world.spawn_entity();
world.set_typed(&env, entity, &Position::new(1, 2));
let pos: Position = world.get_typed(&env, entity).unwrap();
assert_eq!(pos.x, 1);§Stability
- ECS runtime and storage: Stable
app: Stablestandards: Stable- Accounts: Beta
zk::stable: Stablezk::experimental: Experimental
Re-exports§
pub use archetype_world::ArchetypeQuery;pub use archetype_world::ArchetypeQueryBuilder;pub use archetype_world::ArchetypeWorld;pub use commands::CommandQueue;pub use component::Component;pub use component::ComponentId;pub use component::ComponentStorage;pub use component::ComponentTrait;pub use component::Position;pub use ecs::RuntimeWorld;pub use ecs::RuntimeWorldMut;pub use ecs::WorldBackend;pub use error::CougrError;pub use error::CougrResult;pub use event::Event;pub use event::EventReader;pub use event::EventWriter;pub use plugin::GameApp;pub use plugin::Plugin;pub use plugin::PluginGroup;pub use query::QueryStorage;pub use query::SimpleQuery;pub use query::SimpleQueryBuilder;pub use resource::Resource;pub use resource::ResourceTrait;pub use scheduler::ScheduleError;pub use scheduler::ScheduleStage;pub use scheduler::SimpleScheduler;pub use scheduler::SystemConfig;pub use scheduler::SystemGroup;pub use simple_world::SimpleWorld;
Modules§
- accounts
- Account abstraction for Cougr game accounts.
- app
- Default gameplay runtime surface for new Cougr projects.
- archetype_
world - Archetype-based ECS world implementation.
- auth
- Beta account and session surface.
- commands
- component
- ecs
- Curated ECS runtime surface.
- error
- event
- macros
- ops
- Stable operational and contract standards.
- plugin
- prelude
- Common ECS imports for the default onboarding path.
- privacy
- Privacy surface split by maturity tier.
- query
- resource
- runtime
- Advanced runtime primitives that remain supported but are not part of the smallest onboarding surface.
- scheduler
- simple_
world - standards
- Reusable contract standards for Cougr integrations.
- zk
- Zero-knowledge proof support for Cougr.
Macros§
- impl_
component - Implement
ComponentTraitfor a struct with fixed-size fields. - impl_
marker_ component - Implement
ComponentTraitfor a marker (unit) struct. - impl_
resource - Implement
ResourceTraitfor a struct with fixed-size fields.