Skip to content

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

@zaucy

Description

@zaucy

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions