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

Getting Started tips? #23

Open
wiredmatt opened this issue Sep 23, 2023 · 4 comments
Open

Getting Started tips? #23

wiredmatt opened this issue Sep 23, 2023 · 4 comments
Labels
question Further information is requested

Comments

@wiredmatt
Copy link

Hey, awesome work! I'm slowly migrating to monogame, I have little experience with modern c#.

I can successfully setup a Monogame project and run it, and also integrate with base Arch. However I'm not being able to get Arch.Extended's EventBus to play well. I just saw #9 but OP didn't mention how exactly did he solve it. Can the EventBus code be generated by running a command, or by specifying it somehow in the csproj? Thank you in advance. I believe this is also a good opportunity to add brief yet effective documentation on how to setup a project with these tools.

@genaray
Copy link
Owner

genaray commented Sep 23, 2023

Thanks for your interest! :)

Well its a source generator. So it should he integrated like any other source-generator. This depends on your environment however, e.g. in pure c# you can just install it as a nuget package and set it up as a source-gen. Thats all :)

What environment are you using? Engine? Just monogame? ^^

@wiredmatt
Copy link
Author

Hey! thank you for the quick reply, yes I'm using Monogame.

I run what's in the readme after setting up dotnet, and creating a monogame project using dotnet templates.

dotnet add package Arch.System --version 1.0.2
dotnet add package Arch.System.SourceGenerator --version 1.1.1
dotnet add package Arch.EventBus --version 1.0.2
dotnet add package Arch.LowLevel --version 1.0.3
dotnet add package Arch.Relationships --version 1.0.0
dotnet add package Arch.Persistence --version 1.0.2

However, trying to follow your Sample, I get the following:

'EventBus' does not contain a definition for 'Send'

I assume some command should be run, or config added, for example in dart you can do it like this which is super clear to me.

I'm currently reading this but it doesn't look like it's directed at the consumer of a library that uses generators.

$ dotnet build

MSBuild version 17.3.2+561848881 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
/home/mateo/games/flappy-mono/Game1.cs(88,18): error CS0117: 'EventBus' does not contain a definition for 'Send' [/home/mateo/games/flappy-mono/flappy-mono.csproj]

Build FAILED.

/home/mateo/games/flappy-mono/Game1.cs(88,18): error CS0117: 'EventBus' does not contain a definition for 'Send' [/home/mateo/games/flappy-mono/flappy-mono.csproj]
    0 Warning(s)
    1 Error(s)

Every other package picks up well, just this one I don't understand how to configure

@genaray
Copy link
Owner

genaray commented Sep 23, 2023

Have you pulled and tried out the example project from arch.extended? ^^

Does the [Event] annotated method exist? Only if that one exists a .Send will be generated.

@genaray genaray added the question Further information is requested label Oct 25, 2023
@metaphist
Copy link

The above post is the answer - an [Event] method needs to exist or you will see the build error about Send not existing. This should probably be called out in the docs.

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

No branches or pull requests

3 participants