{"id":13418575,"url":"https://github.com/miguelmartin75/anax","last_synced_at":"2025-12-15T19:26:17.121Z","repository":{"id":7880768,"uuid":"9255755","full_name":"miguelmartin75/anax","owner":"miguelmartin75","description":"An open source C++ entity system.","archived":true,"fork":false,"pushed_at":"2021-03-11T17:29:04.000Z","size":6925,"stargazers_count":461,"open_issues_count":26,"forks_count":47,"subscribers_count":32,"default_branch":"master","last_synced_at":"2024-07-31T22:43:29.248Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miguelmartin75.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-06T05:22:52.000Z","updated_at":"2024-06-25T10:35:53.000Z","dependencies_parsed_at":"2022-09-03T09:50:22.994Z","dependency_job_id":null,"html_url":"https://github.com/miguelmartin75/anax","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miguelmartin75%2Fanax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miguelmartin75%2Fanax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miguelmartin75%2Fanax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miguelmartin75%2Fanax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miguelmartin75","download_url":"https://codeload.github.com/miguelmartin75/anax/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243681024,"owners_count":20330152,"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-07-30T22:01:03.963Z","updated_at":"2025-12-15T19:26:12.031Z","avatar_url":"https://github.com/miguelmartin75.png","language":"C++","funding_links":[],"categories":["TODO scan for Android support in followings","[ECS Libraries](#contents)","ECS Libraries","GameProgramming"],"sub_categories":[],"readme":"# anax [![Build Status](https://travis-ci.org/miguelmartin75/anax.svg?branch=master)](https://travis-ci.org/miguelmartin75/anax)\n\n**ARCHIVED: as I haven't maintained this library for at least a couple of years. I don't have the time or interest to work on this. Please use another library or just write your game without an ECS ;)**\n\nanax is an open source C++ entity system designed to be portable, lightweight and easy to use. It is aimed toward Game Development, however it would be possible to use it for other projects.\n\n# What's an Entity System?\n\nAn entity system, or entity component system is a pattern for building complex extensible projects (typically games). It separates functionality into three major parts: components, systems and entities. Where entities are used to describe an object within the game, components are used to store data for the entities to describe them, and systems are used to contain game logic.\n\nYou can read about them further [here](https://github.com/miguelmartin75/anax/wiki/What-is-an-Entity-System%3F).\n\n# Getting Started\n\n## Dependencies\nTo compile, install, and use anax, a C++11 compliant compiler is required.\n\n## Installation\n\n```\n(mkdir -p build \u0026\u0026 cmake .. \u0026\u0026 make install)\n```\n\nA more detailed tutorial on how to install is available on the [wiki](https://github.com/miguelmartin75/anax/wiki/Getting-Started).\n\n# Quick Tutorial\n\nThis section will explain how to use the library, but it will not go into much specific detail. If you want a more detailed guide, please refer to this [page](https://github.com/miguelmartin75/anax/wiki/Using-the-Library) on the [wiki].\n\n\u003e #### **NOTE:**\n\u003e It is assumed you know what an [Entity System](https://github.com/miguelmartin75/anax/wiki/What-is-an-Entity-System%3F) is.\n\n### The World\n\nA World is used to describe you game world or 'entity system' if you will. You must always have at least one World object in order to use anax. e.g.\n\n```c++\nWorld world;\n```\n\n### Entities\n\nAn entity is what you use to describe an object in your game. e.g. a player, a gun, etc. To create entities, you must have a World object, and call `createEntity()` on the World object.\n\n```c++\nWorld world;\n// ... \nEntity entity = world.createEntity();\n```\n\nEntities are implemented as an identifier (32 or 64 bits). The Entity objects have a reference to the World object, and may be accessed via `getWorld()`. The `Entity` class acts as a handle to entities, you can think of it as a pointer. You may have multiple `Entity` handles to represent the same entity, e.g.\n\n```c++\nEntity entity1 = world.createEntity();\nEntity entity2 = entity1; // entity2 and entity1 \"point\" to the same entity\n```\n\nTo destroy/kill an entity, you can either call `World::killEntity` or `Entity::kill`. e.g.\n\n```c++\nentity.kill();\n// or\nworld.killEntity(entity);\n```\n\nOnce you have killed an entity, other copies of your entity handles will automatically be invalidated and will not be of use (an assertion will occur if you attempt to use an invalidated entity). e.g.\n\n```c++\nEntity entity1 = world.createEntity();\nEntity entity2 = entity1;\n\nentity1.kill();\n\n// This will cause an assertion\n// see below for details about this member function\nentity2.addComponent\u003cPosition\u003e(0, 3, 5);\n``` \n\t\n### Components\n\nA Component is used to describe data for an Entity, for example: the position, velocity, etc. To define your own component, you simply inherit from `Component`.\n\n```c++\nstruct PositionComponent : anax::Component\n{\n\t// ...\n};\n```\n\nYou may add/remove/get components to entities through the public methods defined in the entity class.\n\n- `addComponent`\n- `removeComponent`\n- `getComponent`\n\ne.g.\n\n```c++\n// adding components\nentity.addComponent\u003cPositionComponent\u003e(2, 3, 5);\n\n// removing components\nentity.removeComponent\u003cPositionComponent\u003e();\n\n// getting components\nauto pos = entity.getComponent\u003cPositionComponent\u003e();\n```\n\n### Systems\n\nA System is used to contain on entities with specific components (require or exclude a set of component types). It is typically used to update, render or perform some logic these entities. \n\n```c++\nstruct MovementSystem : anax::System\u003canax::Requires\u003cPositionComponent, VelocityComponent\u003e, anax::Excludes\u003cParalizedComponent\u003e\u003e\n{\n\t// ...\n};\n```\n\nThat is, a movement system requires entities with a `PositionComponent` and `VelocityComponent`, also excludes entities with a `ParalizedComponent`. You may determine if an entity is removed/added to the system via these two override-able (virtual) methods:\n\n- `onEntityAdded(Entity\u0026)`\n- `onEntityRemoved(Entity\u0026)`\n\nThat's basically it, you can pretty much go and code. If you want more details, check the documentation or [this](https://github.com/miguelmartin75/anax/wiki/Using-the-Library) getting started guide on the [wiki].\n\n# Get Involved\n\nWant to get involved with the project? You are free to help out on the project, but please see the `CONTRIBUTING.md` file before doing so.\n\nAlso, don't be afraid to send pull requests, especially for those that fix bugs ([email] me if you're unsure)!\n\n# License\n\nSee [LICENSE](LICENSE).\n\n[wiki]: https://github.com/miguelmartin75/anax/wiki\n[CMake]: http://www.cmake.org/\n[Entity Systems]:http://t-machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part-1/)\n[Artemis]: http://gamadu.com/artemis/\n[boost]: http://boost.org/\n[email]: mailto:miguel@miguel-martin.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiguelmartin75%2Fanax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiguelmartin75%2Fanax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiguelmartin75%2Fanax/lists"}