{"id":19348581,"url":"https://github.com/matachi/artemis-cpp","last_synced_at":"2025-04-23T05:33:42.777Z","repository":{"id":6451031,"uuid":"7690580","full_name":"matachi/Artemis-Cpp","owner":"matachi","description":"A C++ port of Artemis Entity System Framework ","archived":false,"fork":false,"pushed_at":"2013-01-20T21:36:27.000Z","size":196,"stargazers_count":2,"open_issues_count":0,"forks_count":63,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-14T14:05:21.426Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":false,"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/matachi.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}},"created_at":"2013-01-18T17:06:50.000Z","updated_at":"2022-09-08T07:48:36.000Z","dependencies_parsed_at":"2022-09-03T01:20:57.298Z","dependency_job_id":null,"html_url":"https://github.com/matachi/Artemis-Cpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matachi%2FArtemis-Cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matachi%2FArtemis-Cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matachi%2FArtemis-Cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matachi%2FArtemis-Cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matachi","download_url":"https://codeload.github.com/matachi/Artemis-Cpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223911324,"owners_count":17223838,"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-11-10T04:21:41.216Z","updated_at":"2024-11-10T04:21:42.397Z","avatar_url":"https://github.com/matachi.png","language":"C++","readme":"Artemis C++\n===\n\nA C++ port of [Artemis Entity System Framework](http://gamadu.com/artemis/tutorial.html).\n\nThe port was orignially written by [Sidar Talei](https://bitbucket.org/stalei/artemiscpp/src), in which he used several C++11 features such as deleted function, variadic templates, nullptr, etc…\nWe wanted the framework to be portable, so we removed all C++11 feature usages.\n\n### PORTED CLASSES\n\n- Component\n- ComponentMapper\n- ComponentType\n- ComponentTypeManager\n- Entity\n- EntityProcessingSystem\n- EntitySystem\n- SystemBitManager\n- ImmutableBag\n- EntityManager\n- DelayedEntityProcessingSystem\n- DelayedEntitySystem\n- GroupManager\n- IntervalEntityProcessingSystem\n- IntervalEntitySystem\n- Manager\n- SystemManager\n- TagManager\n- utils\n- World\n- Bag\n\n### EXAMPLE\n\n`VelocityComponent` and `PositionComponent`.\n\n``` cpp\nclass VelocityComponent : public artemis::Component {\npublic:\n    float velocityX;\n    float velocityY;\n\n    MovementComponent(float velocityX, float velocityY)\n    {\n        this-\u003evelocityX = velocityX;\n        this-\u003evelocityY = velocityY;\n    };\n};\n\nclass PositionComponent : public artemis::Component\n{\n\npublic:\n    float posX;\n    float posY;\n    PositionComponent(float posX, float posY)\n    {\n        this-\u003eposX = posX;\n        this-\u003eposY = posY;\n    };\n};\n```\n\t\nMovementSystem updates positions base on velocities\n\n``` cpp\nclass MovementSystem : public artemis::EntityProcessingSystem {\nprivate:\n    artemis::ComponentMapper\u003cMovementComponent\u003e velocityMapper;\n    artemis::ComponentMapper\u003cPositionComponent\u003e positionMapper;\n\npublic:\n    MovementSystem() {\n        addComponentType\u003cMovementComponent\u003e();\n        addComponentType\u003cPositionComponent\u003e();\n    };\n\n    virtual void initialize() {\n        velocityMapper.init(*world);\n        positionMapper.init(*world);\n    };\n\n    virtual void processEntity(artemis::Entity \u0026e) {\n        positionMapper.get(e)-\u003eposX += velocityMapper.get(e)-\u003evelocityX * world-\u003egetDelta();\n        positionMapper.get(e)-\u003eposY += velocityMapper.get(e)-\u003evelocityY * world-\u003egetDelta();\n    };\n\n};\n```\n\t\nUsage:\n\n``` cpp\nint main(int argc, char **argv) {\n\n    artemis::World world;\n    artemis::SystemManager * sm = world.getSystemManager();\n    MovementSystem * movementsys = (MovementSystem*)sm-\u003esetSystem(new MovementSystem());\n    artemis::EntityManager * em = world.getEntityManager();\n\n    sm-\u003einitializeAll();\n\n    artemis::Entity \u0026 player = em-\u003ecreate();\n\n    player.addComponent(new MovementComponent(2,4));\n    player.addComponent(new PositionComponent(0,0));\n    player.refresh();\n\n    PositionComponent * comp = (PositionComponent*)player.getComponent\u003cPositionComponent\u003e();\n\n    while(true){\n\n        world.loopStart();\n        world.setDelta(0.0016f);\n        movementsys-\u003eprocess();\n\n        std::cout \u003c\u003c \"X:\"\u003c\u003c comp-\u003eposX \u003c\u003c std::endl;\n        std::cout \u003c\u003c \"Y:\"\u003c\u003c comp-\u003eposY \u003c\u003c std::endl;\n        Sleep(160);\n    }\n\n    return 0;\n}\n```\n### LOGS\n\n- Dec 10, 2012:\n\t- [Fixed  bug](https://github.com/vinova/Artemis-Cpp/commit/449ee9d3167d6bdf8056a8da7554ebec016e5b65): calling Bag.get(index) not returning NULL when index \u003e bag's size,\n\twhich leads to memory violation when the number of entities becomes greater than initialized entities bag size.\n- Nov 15, 2012:\n\t- [Fixed  bug](https://github.com/vinova/Artemis-Cpp/commit/fe291598b699cd283fc029ee727669b8e7a76e24): memory leak when add a component to an entity\n\twho already had this component.\n- Sept 11, 2012:\n\t- [Fixed critical bug](https://github.com/vinova/Artemis-Cpp/commit/731d2c3e6f4afbd32e4d33f08f23373d62b91dd9): deleting World doesn't delete/reset all neccessary data,\nwhich will lead to memory violation when a World is deleted and a new one is created.\n- Sept 12, 2012:\n\t- Removed all C++11 feature usages.\n\n### LISENCE\n\nCopyright 2011 GAMADU.COM. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are\npermitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of\n      conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list\n      of conditions and the following disclaimer in the documentation and/or other materials\n      provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY GAMADU.COM ``AS IS'' AND ANY EXPRESS OR IMPLIED\nWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\nFITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GAMADU.COM OR\nCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\nADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nThe views and conclusions contained in the software and documentation are those of the\nauthors and should not be interpreted as representing official policies, either expressed\nor implied, of GAMADU.COM.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatachi%2Fartemis-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatachi%2Fartemis-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatachi%2Fartemis-cpp/lists"}