Git Product home page Git Product logo

gentitas's Introduction

Gentitas - Code Generator for Entitas

Gentitas is a fast code generator for Entitas and a framework on top of Entitas. It watches your Assets folder for Context declarations in .gentitas.cs files and generates Entitas API from them.


Important! This project is dead and no longer maintained, I recommend using official Entitas Code Generator.



First glimpse

// Declaration
namespace Game.YourModule.Declaration
{
    public class State : Context
    {
        State()
        {
            var Application = Component().GroupSingle;
            var RabbitName = Component<string>().Index;
            var Rabbit = Component();
            var RabbitUnit = Component<float>().GroupSingle;
            var Fast = Component();
            var Speed = Component<float>().Group;

            var RabbitWithName = Group(Matcher.All(Rabbit, RabbitName));
            var FastRabbitName = Index(RabbitName, Rabbit, Fast);
        }
    }
}

// If generator is running, it will automatically
// regenerate API so you can use it immediately.

// Usage
void Example ()
{
    // Components
    var entity = Contexts.state.CreateEntity();
    entity.rabbitName = "Steve";
    entity.rabbit = true;
    entity.fast = true;
    entity.speed = 10f;

    // Groups
    var applicationEntity = Contexts.state.applicationEntity;
    var applicationExists = Contexts.state.HasApplication();
    var speedGroup = Contexts.state.speedGroup;
    var speedEntities = Contexts.state.speedEntities;
    var rabbitUnit = Contexts.state.rabbitUnit;
    var rabbitWithNameGroup = Contexts.state.rabbitWithNameGroup;

    // Index
    var numberOfRabbitsWithNameSteve = Contexts.state.fastRabbitNameIndex.GetCount("Steve");
    var rabbitsWithNameSteve = Contexts.state.fastRabbitNameIndex.Find("Steve");
    var rabbitWithNameSteve = Contexts.state.fastRabbitNameIndex.FindSingle("Steve");
}

How to use

  • Download latest version
  • Move downloaded Gentitas folder into your Assets/Plugins* folder
  • Run Tools/Entitas/Check System For Gentitas
  • If you don't have Node.js installed - it will tell you
  • Run Tools/Entitas/Install Gentitas Dependecies
  • Run Tools/Entitas/Start Gentitas Generator
  • Create [AnyFileName].gentitas.cs somewhere in your Assets folder
  • Add declaration code from First glimpse and save file
  • Check your Assets/Generated folder
  • Enjoy generated Entitas API

*It's important to use Plugins folder, otherewise Menu Items will not work.

Download Gentitas

Each release contains framework code, generator code and .sh / .cmd scripts to run generator and install it's dependencies.

Show releases

Contribute

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

Feel free to suggest your ideas.

Maintainer

gentitas's People

Contributors

vladpazych avatar vplifer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

lazuraslong

gentitas's Issues

Add automated tests

  • Path resolving on different platforms
  • Ensuring output directories
  • Naming elements by reading file
  • Map structure checking

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.