mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-01 17:47:24 +02:00
* [Dependency] source generator No more reflection, no more codegen at runtime Also various changes to Roslyn helpers to make this easier to write. Requires all types with dependencies to be partial and not have readonly dependency fields. An analyzer enforces this at warning level, the previous injection strategies have remained in the code *for now* as a fallback. No fallback is available for [field: Dependency] properties, due to a Roslyn bug. Code Fixes exist. We love Roslyn * Apply dependencies generator changes to all code * Release notes * Preprocessor got hands * Handle nullable dependencies These are bad but gotta deal with it. * Apply suggestions from code review Co-authored-by: Moony <moony@hellomouse.net> * Fine, let's not use collection expressions --------- Co-authored-by: Moony <moony@hellomouse.net>
25 lines
787 B
C#
25 lines
787 B
C#
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.IoC;
|
|
|
|
namespace Robust.Client.GameObjects;
|
|
|
|
/// <summary>
|
|
/// An abstract entity system inheritor for systems that deal with appearance data.
|
|
/// </summary>
|
|
public abstract partial class VisualizerSystem<T> : EntitySystem
|
|
where T : Component
|
|
{
|
|
[Dependency] protected AppearanceSystem AppearanceSystem = default!;
|
|
[Dependency] protected AnimationPlayerSystem AnimationSystem = default!;
|
|
[Dependency] protected SpriteSystem SpriteSystem = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<T, AppearanceChangeEvent>(OnAppearanceChange);
|
|
}
|
|
|
|
protected virtual void OnAppearanceChange(EntityUid uid, T component, ref AppearanceChangeEvent args) { }
|
|
}
|