{"id":43952139,"url":"https://github.com/salazarsebas/cougr","last_synced_at":"2026-02-07T04:00:35.036Z","repository":{"id":318767475,"uuid":"1075591329","full_name":"salazarsebas/Cougr","owner":"salazarsebas","description":"Cougr is the future of gaming, but right now.","archived":false,"fork":false,"pushed_at":"2026-02-06T23:51:57.000Z","size":833,"stargazers_count":2,"open_issues_count":4,"forks_count":13,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-07T00:26:07.000Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/salazarsebas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-13T17:55:37.000Z","updated_at":"2026-02-06T21:32:01.000Z","dependencies_parsed_at":"2026-01-29T09:02:26.037Z","dependency_job_id":null,"html_url":"https://github.com/salazarsebas/Cougr","commit_stats":null,"previous_names":["salazarsebas/cougr"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/salazarsebas/Cougr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salazarsebas%2FCougr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salazarsebas%2FCougr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salazarsebas%2FCougr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salazarsebas%2FCougr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/salazarsebas","download_url":"https://codeload.github.com/salazarsebas/Cougr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salazarsebas%2FCougr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29186036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T03:35:06.566Z","status":"ssl_error","status_checked_at":"2026-02-07T03:34:57.604Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-07T04:00:24.664Z","updated_at":"2026-02-07T04:00:35.031Z","avatar_url":"https://github.com/salazarsebas.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cougr Core\n\n**Cougr Core** is a Soroban-compatible ECS (Entity Component System) framework designed for building on-chain video games on the Stellar blockchain.\n\n## Overview\n\nThis crate provides a complete ECS architecture adapted for `no_std` and WebAssembly (WASM) compatibility, built on top of the **soroban-sdk**. It follows an architecture inspired by Bevy ECS, providing a modular and efficient foundation for decentralized gaming experiences.\n\n## Features\n\n- ✅ **Complete ECS Architecture**: Entities, Components, Systems, World, Resources, Events, and Queries\n- ✅ **Soroban-SDK Integration**: Native support for Stellar smart contracts\n- ✅ **no_std Compatible**: Works in constrained environments\n- ✅ **WASM Ready**: Optimized for WebAssembly execution\n- ✅ **Type-Safe**: Leverages Rust's type system for safety\n- ✅ **Efficient Storage**: Optimized component storage systems\n\n## Architecture\n\n### Core Modules\n\n- **entity**: Entity management with unique IDs and generation tracking\n- **component**: Component types and registry for attaching data to entities\n- **world**: Central ECS world containing all entities, components, and systems\n- **system**: System trait and implementations for game logic\n- **storage**: Efficient component storage (Table and Sparse storage)\n- **resource**: Global resources accessible to systems\n- **event**: Event system for communication between systems\n- **query**: Query system for filtering entities by components\n\n## Quick Start\n\n### Installation\n\nAdd to your `Cargo.toml`:\n\n```toml\n[dependencies]\ncougr-core = \"0.0.1\"\n```\n\n### Basic Usage\n\n```rust\nuse cougr_core::prelude::*;\n\n// Create a world\nlet mut world = World::new();\n\n// Spawn an entity\nlet entity = world.spawn_empty();\n\n// Add components\nlet position = Component::new(\n    symbol_short!(\"position\"),\n    position_data\n);\nworld.add_component_to_entity(entity.id(), position);\n\n// Query entities\nlet entities = world.query_entities(\u0026[symbol_short!(\"position\")]);\n```\n\n## Module Documentation\n\n### Entity Module (`entity.rs`)\n\nProvides entity management functionality:\n- `EntityId`: Unique identifier with generation tracking\n- `Entity`: Entity container with component tracking\n- `EntityManager`: Handles entity lifecycle (spawn, despawn, lookup)\n\n### Component Module (`component.rs`)\n\nDefines component types and management:\n- `Component`: Base component type with Soroban serialization\n- `ComponentId`: Unique component type identifier\n- `ComponentRegistry`: Manages component type registration\n- `ComponentTrait`: Trait for implementing custom components\n\n### World Module (`world.rs`)\n\nCentral ECS container:\n- `World`: Main ECS world containing all entities and components\n- Methods for entity/component management\n- Resource and event management\n- Query execution\n\n### System Module (`system.rs`)\n\nSystem execution framework:\n- `System` trait: Define game logic systems\n- `SystemParam`: Parameter types for systems\n- Pre-built systems: MovementSystem, CollisionSystem, HealthSystem\n\n### Storage Module (`storage.rs`)\n\nComponent storage implementations:\n- `Storage`: Base storage type\n- `TableStorage`: Dense storage for common components\n- `SparseStorage`: Sparse storage for rare components\n\n### Resource Module (`resource.rs`)\n\nGlobal state management:\n- `Resource`: Global resources accessible to all systems\n- `ResourceTrait`: Trait for implementing custom resources\n- Example: `GameState` resource\n\n### Event Module (`event.rs`)\n\nEvent system for inter-system communication:\n- `Event`: Base event type\n- `EventReader`: Read events in systems\n- `EventWriter`: Send events from systems\n- Pre-built events: `CollisionEvent`, `DamageEvent`\n\n### Query Module (`query.rs`)\n\nEntity filtering and querying:\n- `Query`: Filter entities by components\n- `QueryState`: Cached query results\n- `QueryBuilder`: Fluent query construction\n- `QueryFilter`: Custom filter trait\n\n## Development\n\n### Building\n\n```bash\ncargo build\n```\n\n### Testing\n\n```bash\ncargo test\n```\n\n### Building for Soroban\n\n```bash\ncargo build --target wasm32-unknown-unknown --release\n```\n\n## Profile Configuration\n\nThe crate is optimized for small WASM binary size:\n- LTO enabled\n- Single codegen unit\n- Size optimization (`opt-level = \"z\"`)\n\n## Compatibility\n\n- **Rust Version**: 1.70.0+\n- **Edition**: 2021\n- **Target**: wasm32-unknown-unknown\n- **Soroban SDK**: 23.0.2\n\n## License\n\nLicensed under MIT OR Apache-2.0\n\n## Contributing\n\nThis is part of the Cougr framework for on-chain gaming on Stellar. Contributions are welcome!\n\n## Resources\n\n- [Soroban Documentation](https://soroban.stellar.org/)\n- [Stellar Documentation](https://developers.stellar.org/)\n- [Rust Documentation](https://www.rust-lang.org/learn)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalazarsebas%2Fcougr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalazarsebas%2Fcougr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalazarsebas%2Fcougr/lists"}