{"id":16214011,"url":"https://github.com/genaray/arch.extended","last_synced_at":"2025-04-04T07:07:34.674Z","repository":{"id":65189211,"uuid":"583082451","full_name":"genaray/Arch.Extended","owner":"genaray","description":" Extensions for Arch with some useful features like Systems, Source Generator and Utils.","archived":false,"fork":false,"pushed_at":"2024-08-08T21:02:50.000Z","size":302,"stargazers_count":162,"open_issues_count":21,"forks_count":36,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-19T09:27:17.982Z","etag":null,"topics":["csharp","dotnet","dotnet-core","ecs","entity-component-system","entity-framework","fast","framework","game","game-development","gamedev","godot","monogame","monogame-framework","unity","utilities"],"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/genaray.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.MD","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}},"created_at":"2022-12-28T17:58:26.000Z","updated_at":"2024-11-18T05:46:02.000Z","dependencies_parsed_at":"2023-11-14T01:23:56.165Z","dependency_job_id":"8b70b9c7-1bd5-424c-be77-e52015ffd483","html_url":"https://github.com/genaray/Arch.Extended","commit_stats":{"total_commits":53,"total_committers":3,"mean_commits":"17.666666666666668","dds":"0.39622641509433965","last_synced_commit":"0c6668c5e1f6e4a15e6b66f18484189c8dc5b665"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/genaray%2FArch.Extended","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/genaray%2FArch.Extended/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/genaray%2FArch.Extended/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/genaray%2FArch.Extended/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/genaray","download_url":"https://codeload.github.com/genaray/Arch.Extended/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247135144,"owners_count":20889421,"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":["csharp","dotnet","dotnet-core","ecs","entity-component-system","entity-framework","fast","framework","game","game-development","gamedev","godot","monogame","monogame-framework","unity","utilities"],"created_at":"2024-10-10T11:09:21.898Z","updated_at":"2025-04-04T07:07:34.666Z","avatar_url":"https://github.com/genaray.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arch.Extended\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg?style=for-the-badge)](https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity)\n[![Nuget](https://img.shields.io/nuget/v/Arch?style=for-the-badge)](https://www.nuget.org/packages/Arch.System/)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg?style=for-the-badge)](https://opensource.org/licenses/Apache-2.0)\n![C#](https://img.shields.io/badge/c%23-%23239120.svg?style=for-the-badge\u0026logo=c-sharp\u0026logoColor=white)\n\nExtensions for [Arch](https://github.com/genaray/Arch) with some useful features like Systems, Source Generator and Utils.\n \n- 🛠️ **_Productive_** \u003e  Adds some useful tools and features to the main repository!\n- ☕️ **_SIMPLE_** \u003e  Works easily, reliably and understandably!\n- 💪 _**MAINTAINED**_ \u003e It's actively being worked on, maintained, and supported!\n- 🚢 _**SUPPORT**_ \u003e Supports .NetStandard 2.1, .Net Core 6 and 7 and therefore you may use it with Unity or Godot!\n\nDownload the packages and get started today! \n```console\ndotnet add package Arch.System --version 1.0.5\ndotnet add package Arch.System.SourceGenerator --version 2.0.0\ndotnet add package Arch.EventBus --version 1.0.2\ndotnet add package Arch.LowLevel --version 1.1.3\ndotnet add package Arch.Relationships --version 1.0.0\ndotnet add package Arch.Persistence --version 2.0.0\ndotnet add package Arch.AOT.SourceGenerator --version 1.0.1\n```\n\n# Features \u0026 Tools\n- ⚙️ **_[Systems](https://github.com/genaray/Arch.Extended/wiki/Systems-API)_** \u003e By means of systems, it is now easy to organize, reuse and arrange queries. \n- ✍️ **_[Source Generator](https://github.com/genaray/Arch.Extended/wiki/Source-Generator)_** \u003e Declarative syntax using attributes and source generator, let your queries write themselves! \n- ✉️ **_[EventBus](https://github.com/genaray/Arch.Extended/wiki/EventBus)_** \u003e A source generated EventBus, send Events with high-performance!\n- 👾 **_[LowLevel](https://github.com/genaray/Arch.Extended/wiki/Lowlevel-\u0026-Resource-Management)_** \u003e Low-level utils and data structures to get rid of GC pressure!\n- 💑 **_[Relationships](https://github.com/genaray/Arch.Extended/wiki/Relationships)_** \u003e Adds simple relationships between entities to arch!\n- 💾 **_[Persistence](https://github.com/genaray/Arch.Extended/wiki/Persistence)_** \u003e JSON and Binary (de)serialization to persist your Worlds!\n- ⌛ **_[AOT Source Generator](https://github.com/genaray/Arch.Extended/wiki/AOT-Source-Generator)_** \u003e Helps with AOT compatibility and reduces boilerplate code! \n\u003e Check the links and the [Wiki](https://github.com/genaray/Arch.Extended/wiki)! \n\n# Full code sample\n\nWith this package you are able to write and group queries and systems for Arch automatically.\nAnd all this with the best possible performance.\n\nThe tools can be used independently of each other.\n\n```cs\n// Components ( ignore the formatting, this saves space )\npublic struct Position{ float X, Y };\npublic struct Velocity{ float Dx, Dy };\n\n// BaseSystem provides several useful methods for interacting and structuring systems\npublic class MovementSystem : BaseSystem\u003cWorld, float\u003e\n{\n    public MovementSystem(World world) : base(world) {}\n    \n    // Generates a query and calls that one automatically on BaseSystem.Update\n    [Query]\n    public void Move([Data] in float time, ref Position pos, ref Velocity vel)\n    {\n        pos.X += time * vel.X;\n        pos.Y += time * vel.Y;\n    }\n    \n    // Generates and filters a query and calls that one automatically on BaseSystem.Update in order\n    [Query]\n    [All\u003cPlayer, Mob\u003e, Any\u003cIdle, Moving\u003e, None\u003cAlive\u003e]  // Attributes also accept non generics :) \n    public void ResetVelocity(ref Velocity vel)\n    {\n        vel = new Velocity{ X = 0, Y = 0 };\n    }\n}\n\npublic class Game \n{\n    public static void Main(string[] args) \n    {     \n        var deltaTime = 0.05f; // This is mostly given by engines, frameworks\n        \n        // Create a world and a group of systems which will be controlled \n        var world = World.Create();\n        var _systems = new Group\u003cfloat\u003e(\n            \"Systems\",\n            new MovementSystem(world),   // Run in order\n            new MyOtherSystem(...),\n            ...\n        );\n      \n        _systems.Initialize();                  // Inits all registered systems\n        _systems.BeforeUpdate(in deltaTime);    // Calls .BeforeUpdate on all systems ( can be overriden )\n        _systems.Update(in deltaTime);          // Calls .Update on all systems ( can be overriden )\n        _systems.AfterUpdate(in deltaTime);     // Calls .AfterUpdate on all System ( can be overriden )\n        _systems.Dispose();                     // Calls .Dispose on all systems ( can be overriden )\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenaray%2Farch.extended","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgenaray%2Farch.extended","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenaray%2Farch.extended/lists"}