{"id":32617727,"url":"https://github.com/cfnptr/ecsm","last_synced_at":"2025-10-30T17:05:30.024Z","repository":{"id":206962417,"uuid":"717009485","full_name":"cfnptr/ecsm","owner":"cfnptr","description":"Easy to use and fast Entity Component System Manager (ECS) C++ library. ","archived":false,"fork":false,"pushed_at":"2025-10-25T15:45:17.000Z","size":713,"stargazers_count":5,"open_issues_count":4,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T17:32:25.734Z","etag":null,"topics":["c17","cpp","cross-platform","easy-to-use","ecs","entity-component-system","library","multi-platform","template"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cfnptr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2023-11-10T10:56:50.000Z","updated_at":"2025-10-25T15:45:21.000Z","dependencies_parsed_at":"2023-12-16T14:00:02.959Z","dependency_job_id":"c6da3ee2-7f58-4102-b84f-fd6b85cbe10b","html_url":"https://github.com/cfnptr/ecsm","commit_stats":null,"previous_names":["cfnptr/ecsm"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/cfnptr/ecsm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfnptr%2Fecsm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfnptr%2Fecsm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfnptr%2Fecsm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfnptr%2Fecsm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cfnptr","download_url":"https://codeload.github.com/cfnptr/ecsm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfnptr%2Fecsm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281844755,"owners_count":26571538,"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","status":"online","status_checked_at":"2025-10-30T02:00:06.501Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["c17","cpp","cross-platform","easy-to-use","ecs","entity-component-system","library","multi-platform","template"],"created_at":"2025-10-30T17:05:27.993Z","updated_at":"2025-10-30T17:05:30.018Z","avatar_url":"https://github.com/cfnptr.png","language":"C++","readme":"# ECSM\n\nEasy to use template based C++ **Entity Component System Manager** [library](https://github.com/cfnptr/ecsm).\n\nThe ECS pattern, or Entity-Component-System pattern, is a design pattern commonly used in game development and \nsimulation software. It is a way to organize and manage the behavior and data of objects within a system. \nThe ECS pattern is particularly useful for systems with a large number of entities that can have varying and \ndynamic sets of attributes.\n\nSee the [documentation](https://cfnptr.github.io/ecsm)\n\n## Features\n\n* Straightforward template architecture\n* Custom event creation support\n* Cache friendly linear pools\n* Acceptable compilation time\n* Fast component iteration\n* Fast entity component access\n* Singleton class pattern\n\n## Usage example\n\n```cpp\nusing namespace ecsm;\n\nstruct RigidBodyComponent final : public Component\n{\n    float size = 0.0f;\n};\n\nclass PhysicsSystem final : public ComponentSystem\u003cRigidBodyComponent, false\u003e\n{\n    PhysicsSystem()\n    {\n        ECSM_SUBSCRIBE_TO_EVENT(\"Update\", PhysicsSystem::update);\n    }\n    ~PhysicsSystem() final\n    {\n        if (Manager::get()-\u003eisRunning)\n            ECSM_UNSUBSCRIBE_FROM_EVENT(\"Update\", PhysicsSystem::update);\n    }\n\n    void copyComponent(View\u003cComponent\u003e source, View\u003cComponent\u003e destination) final\n    {\n        const auto sourceView = View\u003cRigidBodyComponent\u003e(source);\n        auto destinationView = View\u003cRigidBodyComponent\u003e(destination);\n        destinationView-\u003esize = sourceView-\u003esize;\n    }\n\n    void update()\n    {\n        for (auto\u0026 component : components)\n        {\n            if (!component-\u003egetEntity())\n                continue;\n\n            // Process your component\n        }\n    }\n\n    friend class ecsm::Manager;\n};\n\nvoid ecsmExample()\n{\n    auto manager = new ecsm::Manager();\n    manager-\u003ecreateSystem\u003cPhysicsSystem\u003e();\n    manager-\u003ecreateSystem\u003cGraphicsSystem\u003e(false, 123); // System arguments\n    // ...\n\n    manager-\u003einitialize();\n\n    auto rigidBody = manager-\u003ecreateEntity();\n    auto rigidBodyView = manager-\u003eadd\u003cRigidBodyComponent\u003e(rigidBody);\n    rigidBodyView-\u003esize = 1.0f;\n\n    manager-\u003estart();\n\n    delete manager;\n}\n```\n\n## Supported operating systems\n\n* Windows\n* macOS\n* Ubuntu (Linux)\n\n## Build requirements\n\n* C++17 compiler\n* [Git 2.30+](https://git-scm.com/)\n* [CMake 3.16+](https://cmake.org/)\n\nUse building [instructions](BUILDING.md) to install all required tools and libraries.\n\n### CMake options\n\n| Name              | Description               | Default value |\n|-------------------|---------------------------|---------------|\n| ECSM_BUILD_SHARED | Build ECSM shared library | `ON`          |\n| ECSM_BUILD_TESTS  | Build ECSM library tests  | `ON`          |\n\n### CMake targets\n\n| Name        | Description          | Windows | macOS    | Linux |\n|-------------|----------------------|---------|----------|-------|\n| ecsm-static | Static ECSM library  | `.lib`  | `.a`     | `.a`  |\n| ecsm-shared | Dynamic ECSM library | `.dll`  | `.dylib` | `.so` |\n\n## Cloning\n\n```\ngit clone --recursive https://github.com/cfnptr/ecsm\n```\n\n## Building ![CI](https://github.com/cfnptr/ecsm/actions/workflows/cmake.yml/badge.svg)\n\n* Windows: ```./scripts/build-release.bat```\n* macOS / Ubuntu: ```./scripts/build-release.sh```\n\n## Third-party\n\n* [robin-map](https://github.com/Tessil/robin-map) (MIT license)\n\n### Special thanks to Sahak Grigoryan.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfnptr%2Fecsm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcfnptr%2Fecsm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfnptr%2Fecsm/lists"}