Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signals changes #34

Open
Matt-MX opened this issue Jun 27, 2024 · 1 comment
Open

Signals changes #34

Matt-MX opened this issue Jun 27, 2024 · 1 comment

Comments

@Matt-MX
Copy link
Owner

Matt-MX commented Jun 27, 2024

Signals should be modified to be easily implemented into other components the library provides.

This includes scoreboards

val foo = signal("something")

scoreboard(!"&cTest Signal") {
    +!"&fValue: &e${foo()}"
}

val fooArg by stringArgument()
("setFoo" / fooArg).runs<Player> {
    foo setTo fooArg()
}

Additionally the RefreshBlock should be abstracted to be used in other components.

val ping by refresh { player.ping }

scoreboard(!"&fYour ping") {
    +!"&fPing: &7${ping}"
    +!"&cThis line won't update since we don't change"
}
Matt-MX added a commit that referenced this issue Jul 4, 2024
Syntax/structure not final.
@Matt-MX
Copy link
Owner Author

Matt-MX commented Jul 4, 2024

By this I mean that the Signal class should not have a singular owner object, and should instead be available anywhere in the program.

When used in a block that implements the SignalListener interface, we should then mark this as a dependency for this Signal instance.

We also will need a way to remove these dependencies when they are no longer required otherwise we'll have a memory leak 😱

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant