Giter Club home page Giter Club logo

lightweightsignalbuses's Introduction

  • I’m currently working on Hyperstacks, Undead Citadel & a couple of public frameworks that you can check down below
  • 学习中文,当前水平:HSK3
  • Ask me about whatever gamedev related thing
  • The easiest way to reach me is on Discord, DiscordID extrys

lightweightsignalbuses's People

Contributors

extrys avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

nrosa01

lightweightsignalbuses's Issues

Fix documentation Signals Example

This is the documentation example that's not correct

//The signal types
public struct SignalPlayerDamaged : ISignalPlayerHpChanged
{
    ISignalPlayerHpChanged.PlayerHp => playerHp;
    public float playerHp;
}
public struct SignalPlayerDamaged : ISignalPlayerHpChanged
{
    ISignalPlayerHpChanged.PlayerHp => playerHp;
    public float playerHp;
}

//The interface for the signals
public struct ISignalPlayerHpChanged
{
    float PlayerHp { get; }
}

This is the correct version that compiles

//The interface for the signals
public interface ISignalPlayerHpChanged
{
    public float PlayerHp { get; }
}

//The signal types
public struct SignalPlayerDamaged : ISignalPlayerHpChanged
{
    public float playerHp;

    public float PlayerHp => playerHp;
}

public struct SignalPlayerHealed : ISignalPlayerHpChanged
{
    public float playerHp;

    public float PlayerHp => playerHp;
}

Inconsistent use of the tool

Actual Behaviour:

You have to call abstract signals using SignalBus.AbstractFire<T>(T t)

Desired Behaviour

You should be able to call it SignalBus<T>.AbstractFire(T t)

Motivation:

SignalBus class is used for everything except for abstract Signals, which feels a little odd. I propose that InterfaceCompatibleSignal.cs classes are just helpers for LightWeightSignalBus.cs abstracted to the user.

Proposal:

Add AbstractFire method to SignalBus that internally calls Signal.AbstractFire(T t)

Separate SignalBus and SignalBus<T> classes

This repo contains two classes that are similar but not the same and can be confusing to have both. I would suggest splitting the repo into two and improving documentation, as the one we have now in the readme aren't good as it has errors and don't compile

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.