{"id":16221562,"url":"https://github.com/rahix/eagre-ecs","last_synced_at":"2025-07-17T01:36:33.037Z","repository":{"id":91956632,"uuid":"63535169","full_name":"Rahix/eagre-ecs","owner":"Rahix","description":"A Rust entity-component system","archived":false,"fork":false,"pushed_at":"2017-12-29T12:50:17.000Z","size":568,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-14T02:22:45.388Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rahix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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}},"created_at":"2016-07-17T14:11:25.000Z","updated_at":"2020-03-22T17:06:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"4ae8b5a7-a6e9-4781-a5f8-bebf796fbdf5","html_url":"https://github.com/Rahix/eagre-ecs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Rahix/eagre-ecs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahix%2Feagre-ecs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahix%2Feagre-ecs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahix%2Feagre-ecs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahix%2Feagre-ecs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rahix","download_url":"https://codeload.github.com/Rahix/eagre-ecs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahix%2Feagre-ecs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265558772,"owners_count":23787976,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-10-10T12:08:54.478Z","updated_at":"2025-07-17T01:36:33.028Z","avatar_url":"https://github.com/Rahix.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/Rahix/eagre-ecs.svg?branch=master)](https://travis-ci.org/Rahix/eagre-ecs)\neagre-ecs\n=========\n\nAn Entity-Component System\n\n## Installation ##\n\nAdd the following line to your `Cargo.toml`:\n\n```toml\neagre-ecs = { git = \"https://github.com/Rahix/eagre-ecs\" }\n```\n\n## Example ##\n\n```rust\nextern crate eagre_ecs;\nuse eagre_ecs::prelude::*;\n\n#[derive(Clone, Debug)]\nstruct Foo(i32);\n\n#[derive(Clone, Debug)]\nstruct Bar(i32);\n\nfn main() {\n    let mut system = System::new();\n    for i in 0..100 {\n        let ent = system.new_entity();\n        match i%2 {\n            0 =\u003e system.add(ent, Foo(i)).unwrap(),\n            1 =\u003e system.add(ent, Bar(i)).unwrap(),\n            _ =\u003e unreachable!(),\n        }\n    }\n    system.run_mut::\u003cFoo, _\u003e(|sys: \u0026mut System, ent: Entity| {\n        sys.borrow_mut::\u003cFoo\u003e(ent).unwrap().0 += 1;\n    }).unwrap();\n    system.run_mut::\u003cBar, _\u003e(|sys: \u0026mut System, ent: Entity| {\n        sys.borrow_mut::\u003cBar\u003e(ent).unwrap().0 -= 1;\n    }).unwrap();\n    system.run::\u003ceagre_ecs::All, _\u003e(|sys: \u0026System, ent: Entity| {\n        if sys.has::\u003cFoo\u003e(ent) {\n            println!(\"Foo: {}\", sys.borrow::\u003cFoo\u003e(ent).unwrap().0);\n        } else {\n            println!(\"Bar: {}\", sys.borrow::\u003cBar\u003e(ent).unwrap().0);\n        }\n    }).unwrap();\n}\n```\n\n## License ##\neagre-ecs is licensed under either of\n\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahix%2Feagre-ecs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frahix%2Feagre-ecs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahix%2Feagre-ecs/lists"}