Giter Club home page Giter Club logo

palkia's Introduction

Palkia

An Entity-Component-Message architecture crate.

What's an Entity-Component-Message architecture?

Here's an excert from the blog post I wrote on it:

Like in ECS, under ECM you have entities, which are lists of components. But, instead of linking behavior of different components with systems, you do it by passing messages.

When you implement Component for a struct, you implement a method that registers that struct with different message types. Then, from a message handler, you can fire messages to other entities.

When an entity gets a message, it runs through its components in order, and if that component type registers a handler for that message type, it runs the handler and passes the updated value to the next component, and so on … and then finally returns the modified message to the caller.

And there’s a method on World to pass a message to all entities, as your entrypoint.

Check out the tests or examples for more, I guess.

Why is it called Palkia?

I've been naming the helper crates for Foxfire after Pokemon, just because there's a lot of them and I don't want to spend tons of time coming up with names. I picked Palkia specifically because the crate provides a method of organizing data, and Palkia controls space.


palkia's People

Contributors

gamma-delta avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

szabgab

palkia's Issues

Add derive macros for Message and Resource marker type

While, in terms of length, there isn't much of a difference between
#[derive(Resource)]
and
impl Resource for CoolType {}
it would produce cleaner code as impl blocks are usually bordered by empty lines and you could put it together with other derived traits.
Also, you can see if the trait is a resource/message at first glance instead of looking for a impl block somewhere.

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.