Skip to main content

Crate cougr_core

Crate cougr_core 

Source
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
  • app for the default gameplay runtime surface
  • auth for beta account and session flows
  • privacy for stable and experimental privacy surfaces
  • ops for stable operational standards
  • accounts for account abstraction and session flows
  • zk::stable for stable privacy primitives
  • zk::experimental for 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: Stable
  • standards: Stable
  • Accounts: Beta
  • zk::stable: Stable
  • zk::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 ComponentTrait for a struct with fixed-size fields.
impl_marker_component
Implement ComponentTrait for a marker (unit) struct.
impl_resource
Implement ResourceTrait for a struct with fixed-size fields.