Skip to content

xuyennguyen/Entitas-CSharp

 
 

Repository files navigation

Entitas

Thank you!

<a href="https://gitter.im/sschmid/Entitas-CSharp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge">
    <img src="https://img.shields.io/badge/gitter-join%20chat-brightgreen.svg" alt="Join the chat at https://gitter.im/sschmid/Entitas-CSharp"></a>

<a href="https://twitter.com/intent/follow?original_referer=https%3A%2F%2Fgithub.com%2Fsschmid%2FEntitas-CSharp&screen_name=s_schmid&tw_p=followbutton">
    <img src="https://img.shields.io/badge/twitter-follow%20%40s__schmid-blue.svg" alt="Twitter Follow Me"></a>

<a href="https://travis-ci.org/sschmid/Entitas-CSharp">
    <img src="https://travis-ci.org/sschmid/Entitas-CSharp.svg?branch=master" alt="Build Status"></a>

<a href="https://github.com/sschmid/Entitas-CSharp/releases">
    <img src="https://img.shields.io/github/release/sschmid/Entitas-CSharp.svg" alt="Latest release"></a>

The Entity Component System for C# and Unity

Entitas is a super fast Entity Component System (ECS) specifically made for C# and Unity. Internal caching and blazing fast component access makes it second to none. Several design decisions have been made to work optimal in a garbage collected environment and to go easy on the garbage collector. Entitas comes with an optional code generator which radically reduces the amount of code you have to write and makes your code read like well written prose.

CSharp Unity3d Unite Europe 2015 Unite Boston 2015 Wooga


Watch the talk from Unite Europe 2015

» Open the slides on SlideShare

UniteEurope 2015

First glimpse

The optional code generator lets you write code that is super fast, safe and literally screams its intent.

public static Entity CreateRedGem(this Pool pool, int x, int y) {
    return pool.CreateEntity()
               .IsGameBoardElement(true)
               .IsMovable(true)
               .AddPosition(x, y)
               .AddResource(Res.redGem)
               .IsInteractive(true);
}
var entities = pool.GetEntities(Matcher.AllOf(Matcher.Move, Matcher.Position));
foreach (var entity in entities) {
    var move = entity.move;
    var pos = entity.position;
    entity.ReplacePosition(pos.x, pos.y + move.speed);
}

Overview

Entitas is fast, light and gets rid of unnecessary complexity. There are less than a handful classes you have to know to rocket start your game or application:

  • Entity
  • Pool
  • Group
  • Group Observer

Read more...

Code Generator

The Code Generator generates classes and methods for you, so you can focus on getting the job done. It radically reduces the amount of code you have to write and improves readability by a huge magnitude. It makes your code less error-prone while ensuring best performance. I strongly recommend using it!

Read more...

Unity integration

The optional Unity module integrates Entitas nicely into Unity and provides powerful editor extensions to inspect and debug pools, groups, entities, components and systems.

Read more...

Entitas.Unity MenuItems Entitas.Unity.VisualDebugging Entity Entitas.Unity.VisualDebugging Systems

Entitas deep dive

Read the wiki or checkout the awesome example projects to see Entitas in action. These example projects illustrate how systems, groups, observers and entities all play together seamlessly.

Download Entitas

Each release is published with zip files attached containing all source files you need.

Entitas-CSharp.zip

  • Entitas
  • Entitas.CodeGenerator

Entitas-Unity.zip

  • Entitas
  • Entitas.CodeGenerator
  • Entitas.Unity
  • Entitas.Unity.CodeGenerator
  • Entitas.Unity.VisualDebugging

Show releases

Contributing to Entitas

The project is hosted on GitHub where you can report issues, fork the project and submit pull requests.

Entitas.sln contains all projects and tests in one solution. All Unity projects are not committed to the repository and can be generated with Unity. Open Entitas.Unity, Entitas.Unity.CodeGenerator and Entitas.Unity.VisualDebugging in Unity and generate all projects by clicking Assets -> Sync MonoDevelop Project.

To run the tests, navigate to the project root folder and execute runTests.sh.

  • Check the issues to make sure nobody hasn't already requested it and/or contributed it
  • Fork the project
  • Checkout the latest develop
  • Start a feature/yourFeatureOrBugfix branch based on the latest develop
  • Make sure to add/update tests. This is important so nobody will break it in a future version. Please write tests first, followed by the implementation.
  • Commit and push until you are happy with your contribution
  • Create a pull request

Thanks to

Big shout out to @mzaks, @cloudjubei and @devboy for endless hours of discussion and helping making Entitas awesome!

Maintainer(s)

Different language?

Entitas is also available in

About

Entitas is a super fast Entity Component System (ECS) specifically made for C# and Unity

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 99.6%
  • Shell 0.4%