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

Static class that encompasses all default instances dictated by settings #38

Open
zaucy opened this issue Oct 3, 2022 · 0 comments · Fixed by #41
Open

Static class that encompasses all default instances dictated by settings #38

zaucy opened this issue Oct 3, 2022 · 0 comments · Fixed by #41
Assignees

Comments

@zaucy
Copy link
Member

zaucy commented Oct 3, 2022

In the settings you can specify a lot of things about ecsact. Things such as your default registry and where your default runtime is loaded from. These apis are all scattered everywhere. The idea here is to create a single static class that holds these defaults and makes them available anywhere, easily.

namespace Ecsact {
  public static class Defaults {
    // Optional. Only set if runtime successfully loaded and was configured correctly.
    public static EcsactRuntime? Runtime;
    // Optional. Only set if a default registry is set in the settings.
    public static EcsactRegistry? Registry;
    // Optional. Only here if unity sync is enabled.
    public static EntityGameObjectPool? Pool;
    // Optional. Only set if you have a default registry _AND_ your runner is set to something other than "none".
    public static Ecsact.Runner? Runner;
  }
}

NOTE: We should not allow these to be set by the user. Maybe doing a getter/setter to prevent that would work.

@Kelwan Kelwan self-assigned this Oct 3, 2022
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

Successfully merging a pull request may close this issue.

2 participants