Vixen
dd8b0a81
csharp
public sealed class GameSystemAttribute

Says a system belongs to this project's frame, so anything that runs the project runs it.

Read the guide page for this →

As a annotation

Valid on
Class

Remarks

The thing a project had no way to say. A game's system set was imperative code in its own Game.OnInitialise — loop.Add(new NavigationSystem(crowd)) and a dozen more — so the set existed only as the side effect of running the game's boot path. Nothing could read it: not the editor, which is why Play mode could name a project's systems by reflection and not run any of them, and not a test, and not a tool. This attribute is the declaration that was missing, and it is deliberately the only new thing a project has to write.

⚠ It carries nothing, because everything it might carry is already said elsewhere. A system's phase is [UpdateInGroup] and its order is [UpdateBefore] / [UpdateAfter]; what it reads and writes is [Reads] / [Writes] or IDeclaredAccess. And what it *needs* is its constructor — see Requires, which is the parameter list and nothing more. An attribute that repeated any of those would be a second opinion that can go stale.

⚠ Opt-in, and the engine's own systems do not carry it. A system in Vixen.Rendering or Vixen.Physics is added by whatever built the service it runs against — the app host, or an IPlaySystems contribution in the editor — because that owner is the only thing that knows the service's lifetime. This is for the half the *project* owns.

Additive. Nothing stops a project from carrying on constructing its systems by hand, and a declared system and a hand-constructed one are the same thing to SystemGraph. What a project must not do is both for one system, because nothing dedupes and the frame would run it twice — which includes calling AddDeclaredSystems from its own OnInitialise, since VixenApplication.Initialise already calls it as soon as that returns.

Used by (14)

  • IntruderSystemAiVillage
  • NeedsAValueVixen.Engine.Tests
  • NeedsNothingVixen.Engine.Tests
  • NeedsOneVixen.Engine.Tests
  • NeedsTwoVixen.Engine.Tests
  • ThrowsOnConstructionVixen.Engine.Tests
  • BookkeepingSystemVixen.Cli.Tests
  • ClockSystemVixen.Cli.Tests
  • HaulSystemVixen.Cli.Tests
  • HostedFrameVixen.App.Tests
  • ProjectSystemVixen.Editor.SceneView.Tests
  • ScrapSystemVixen.Cli.Tests
  • StraySystemVixen.Cli.Tests
  • ValuedSystemVixen.Editor.SceneView.Tests