Vixen
dd8b0a81
csharp
public sealed class GameSystemDeclaration

One system a project declared: what it is, what it needs, and how to build it.

Read the guide page for this →

Remarks

⚠ The factory is emitted, not reflected. GameSystemGenerator writes a lambda that calls the constructor with the arguments cast to their declared types, so there is no ConstructorInfo.Invoke anywhere in this path. That is the same reason ServiceRegistry is not a DI container: under NativeAOT the reflective version does not work at all, and the emitted one is shorter as well as faster.

Fields and properties (3)

  • public Type SystemType

    The system's type.

  • public string Name

    Its short name, which is what a report calls it.

  • public IReadOnlyList<Type> Requires

    The services its constructor takes, in order, by the type it declared them as.

Methods (2)

  • public GameSystemDeclaration(Type systemType, Type[] requires, Func<object[], ISystem> factory)

    Declares a system. Called by generated code.

  • public bool TryCreate(IServiceProvider services, out ISystem? system, out Type? missing)

    Builds the system, if everything it needs is there.

Used by (6)

  • VillageRunAiVillage.Agent.Tests
  • VillageTestsAiVillage.Agent.Tests
  • GameSystemRegistryVixen.Engine
  • GameSystemTestsVixen.Engine.Tests
  • GameSystemsVixen.Engine
  • SystemsRunnerVixen.Cli