{"id":22426632,"url":"https://github.com/theypsilon/miniecs","last_synced_at":"2025-03-27T06:22:41.639Z","repository":{"id":152994426,"uuid":"216685162","full_name":"theypsilon/MiniECS","owner":"theypsilon","description":"C# minimalistic entity framework","archived":false,"fork":false,"pushed_at":"2019-10-22T00:44:48.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T11:30:17.300Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"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/theypsilon.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-21T23:45:09.000Z","updated_at":"2019-10-22T00:44:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"951727ca-bcf2-432e-ab60-075264dd846e","html_url":"https://github.com/theypsilon/MiniECS","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theypsilon%2FMiniECS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theypsilon%2FMiniECS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theypsilon%2FMiniECS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theypsilon%2FMiniECS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theypsilon","download_url":"https://codeload.github.com/theypsilon/MiniECS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245792962,"owners_count":20672881,"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-12-05T19:22:47.094Z","updated_at":"2025-03-27T06:22:41.597Z","avatar_url":"https://github.com/theypsilon.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MiniECS\nC# minimalistic entity framework\n\nThis is a very basic entity framework intended for usage with C# 6 runtimes.\n\n## Basic Example\n\n```csharp\npublic class PositionComponent {\n    public Point Point;\n}\n\npublic class LinearMovementComponent\n{\n    public Point Direction;\n    public float Step;\n}\n\n// ...\n// Initialization\n\nvar ecs = new ECS(Define.EntityQuantity, 4096);\n\nvar positionComponents = ecs.CreatePool\u003cPositionComponent\u003e(4096);\nvar linearMovementComponents = ecs.CreatePool\u003cLinearMovementComponent\u003e(4096);\n\nvar limits = ctx.State.Simulation.SpacialLimits; // Simulation State structure defined somewhere else\n\nfor (var i = 0; i \u003c 4096; i++) {\n    var entity = ecs.CreateEntity();\n\n    positionComponents.NewComponent(entity);\n    var position = positionComponents.Get(entity);\n    position.Point = random.GeneratePointWithin(limits);\n\n    linearMovementComponents.NewComponent(entity);\n    var linearMovement = linearMovementComponents.Get(entity);\n    linearMovement.Direction = random.GeneratePoint().normalize();\n    linearMovement.Step = random.GetFloat(0.1f, 30.0f);\n}\n\n// ...\n// Update\n\nvar dt = ctx.State.Simulation.Dt;\n\nforeach (var entity in linearMovementComponents.View()) {\n    var position = ctx.Pools.PositionComponents.Get(entity);\n    var linearMovement = ctx.Pools.LinearMovementComponents.Get(entity);\n    var step = linearMovement.Step;\n\n    position.Point += linearMovement.Direction * step * dt;\n\n    if (!limits.Contain(position.Point)) {\n        ecs.Destroy(entity);\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheypsilon%2Fminiecs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheypsilon%2Fminiecs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheypsilon%2Fminiecs/lists"}