Skip to content

C# cleaner signal emission (v2) - #70321

Closed
OlliO6 wants to merge 0 commit into
godotengine:masterfrom
OlliO6:C#--Cleaner-Signal-Emission-(v2)
Closed

C# cleaner signal emission (v2)#70321
OlliO6 wants to merge 0 commit into
godotengine:masterfrom
OlliO6:C#--Cleaner-Signal-Emission-(v2)

Conversation

@OlliO6

@OlliO6 OlliO6 commented Dec 19, 2022

Copy link
Copy Markdown

Provides a type safe way to emit signals in c#.

Previous:

EmitSignal(SignalName.SomethingHappened, arg1, arg2, arg3);
// This does not have syntax highlighting and compile error when signature is not met.

Now:

GetEmitter<SignalEmitter.SomethingHappened>().Emit(arg1, arg2, arg3);

I also implemented that enums can be used.

Previous PR: C#: Cleaner signal emission
Can't be archieved seamlessly (allocations or pullotion)

Alternative: C#: Generate strongly-typed method to raise signal events and fix event accessibility

  • Pollutes classes
  • Shorter code

@Chaosus

Chaosus commented Dec 21, 2022

Copy link
Copy Markdown
Member

Thanks for the contribution. Conflicts must be resolved, commits must be squashed (see https://docs.godotengine.org/en/latest/community/contributing/pr_workflow.html#modifying-a-pull-request).

@Chaosus Chaosus added this to the 4.x milestone Dec 21, 2022
@OlliO6 OlliO6 closed this Dec 21, 2022
@OlliO6
OlliO6 force-pushed the C#--Cleaner-Signal-Emission-(v2) branch from a3225c2 to 63f95c0 Compare December 21, 2022 11:06
@OlliO6

OlliO6 commented Dec 21, 2022

Copy link
Copy Markdown
Author

Ok, I created some kind of a mess by trying to squish the commits. But yeah here's a new PR squished and no conflicts #70424

@aaronfranke aaronfranke removed this from the 4.x milestone Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants