From 92084384cdd0241d0bc38d3ad80d974ceab4a62a Mon Sep 17 00:00:00 2001 From: sebas77 Date: Tue, 12 Apr 2022 12:44:26 +0100 Subject: [PATCH] update readme --- README.md | 31 ++++++++++++++++++++++- com.sebaslab.svelto.common | 2 +- com.sebaslab.svelto.ecs/CHANGELOG.md | 2 +- com.sebaslab.svelto.ecs/Svelto.ECS.csproj | 5 ++++ 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b2eb863..2c3774d 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,36 @@ Real ECS framework for c\#. Enables to write encapsulated, decoupled, maintainab Svelto.ECS is easy to start with, but full of tricks for expert users. The hardest problem to overcome is usually to shift mentality from OOP programming to ECS programming more than using the framework itself. ### Svelto.ECS at glance -WIP +```csharp + public class SimpleContext + { + public SimpleContext() + { + var simpleSubmissionEntityViewScheduler = new SimpleEntitiesSubmissionScheduler(); + //Build Svelto Entities and Engines container, called EnginesRoot + _enginesRoot = new EnginesRoot(simpleSubmissionEntityViewScheduler); + + var entityFactory = _enginesRoot.GenerateEntityFactory(); + var entityFunctions = _enginesRoot.GenerateEntityFunctions(); + + //Add an Engine to the enginesRoot to manage the SimpleEntities + var behaviourForEntityClassEngine = new BehaviourForEntityClassEngine(entityFunctions); + _enginesRoot.AddEngine(behaviourForEntityClassEngine); + + //build a new Entity with ID 0 in group0 + entityFactory.BuildEntity(new EGID(0, ExclusiveGroups.group0)); + + //submit the previously built entities to the Svelto database + simpleSubmissionEntityViewScheduler.SubmitEntities(); + + //as Svelto doesn't provide an engine ticking system, it's the user's responsibility to + //update engines + behaviourForEntityClassEngine.Update(); + } + + readonly EnginesRoot _enginesRoot; + } +``` ## Why using Svelto.ECS with Unity? Svelto.ECS wasn't born just from the needs of a large team, but also as a result of years of reasoning behind software engineering applied to game development. Svelto.ECS hasn't been written just to develop faster code, it has been designed to help develop better code. Performance gains is just one of the benefits in using Svelto.ECS, as ECS is a great way to write cache-friendly code. Svelto.ECS has been developed with the idea of ECS being a paradigm and not just a pattern, letting the user shift completely away from Object Oriented Programming with consequent improvements of the code design and code maintainability. Svelto.ECS is the result of years of iteration of the ECS paradigm applied to real game development with the intent to be as foolproof as possible. Svelto.ECS has been designed to be used by a medium-size/large team working on long term projects where the cost of maintainability is relevant. diff --git a/com.sebaslab.svelto.common b/com.sebaslab.svelto.common index 14e47cf..3e3a02d 160000 --- a/com.sebaslab.svelto.common +++ b/com.sebaslab.svelto.common @@ -1 +1 @@ -Subproject commit 14e47cff9ec13489c26ce68dd50ea0fea896b57f +Subproject commit 3e3a02d49fdcc7b0b22bb22df525eb5940ab69d4 diff --git a/com.sebaslab.svelto.ecs/CHANGELOG.md b/com.sebaslab.svelto.ecs/CHANGELOG.md index 82055ac..368a606 100644 --- a/com.sebaslab.svelto.ecs/CHANGELOG.md +++ b/com.sebaslab.svelto.ecs/CHANGELOG.md @@ -13,7 +13,7 @@ All notable changes to this project will be documented in this file. Changes are * Improved Serialization system * Improved SveltoOnDots system * Tons of other improvements and bug fixes -~~~~ + ## [3.2.5] * refactor and improved NativeBag and UnsafeBlob. This fix a previously known crash with Unity IL2CPP diff --git a/com.sebaslab.svelto.ecs/Svelto.ECS.csproj b/com.sebaslab.svelto.ecs/Svelto.ECS.csproj index 30aba14..e8abc68 100644 --- a/com.sebaslab.svelto.ecs/Svelto.ECS.csproj +++ b/com.sebaslab.svelto.ecs/Svelto.ECS.csproj @@ -48,4 +48,9 @@ + + + README.md + + \ No newline at end of file