From d2d9e2b0ccbead40d1b215fbc84c1360020c2734 Mon Sep 17 00:00:00 2001 From: Moony Date: Fri, 27 May 2022 20:07:25 -0500 Subject: [PATCH] Finally fixes file templates (#8476) * Add entitysystem and component templates. * Adds doc comments to templates and also a prototype template. * Add an inheriting prototype template. * add inheritdocs where appropriate. --- SpaceStation14.sln.DotSettings | 302 +++++++++++++++++++++++++++------ 1 file changed, 248 insertions(+), 54 deletions(-) diff --git a/SpaceStation14.sln.DotSettings b/SpaceStation14.sln.DotSettings index 936e3d7481..45118b13cb 100644 --- a/SpaceStation14.sln.DotSettings +++ b/SpaceStation14.sln.DotSettings @@ -76,15 +76,93 @@ <data><IncludeFilters /><ExcludeFilters><Filter ModuleMask="*.UnitTesting" ModuleVersionMask="*" ClassMask="*" FunctionMask="*" IsEnabled="True" /></ExcludeFilters></data> True False - - - 8 - 6 - True - <No Name> - 9 - 7 + True + Entity System + 10 + + + 9 + True + Entity System + 14 + 6 + 7 + True + Entity System + 11 + True + Entity Component + 12 + 8 + True + Prototype + 15 + True + Shared Net Component + 13 False + True + True + cs + FooComponent + True + &Entity Component + True + getAlphaNumericFileNameWithoutExtension() + 2 + True + fileheader() + 0 + True + fileDefaultNamespace() + 1 + True + True + InCSharpProjectFile + True + $HEADER$namespace $NAMESPACE$; + +/// <summary> +/// $CLASS$ is used for... +/// </summary> +[RegisterComponent] +public sealed class $CLASS$ : Component { + $END$ +} + SS14 + True + True + cs + FooPrototype + True + &Prototype + True + getAlphaNumericFileNameWithoutExtension() + 2 + True + fileheader() + 0 + True + fileDefaultNamespace() + 1 + True + True + InCSharpProjectFile + True + $HEADER$using Robust.Shared.Prototypes; + +namespace $NAMESPACE$; + +/// <summary> +/// $CLASS$ is a prototype for... +/// </summary> +[Prototype($END$)] +public sealed class $CLASS$ : IPrototype { + /// <inheritdoc/> + [IdDataField] + public string ID { get; } = default!; +} + SS14 True True IoC [Dependency] @@ -100,6 +178,19 @@ dep True [Robust.Shared.IoC.Dependency] private readonly $TYPE$ $NAME$ = default!;$END$ + False + False + True + + + -1 + False + False + + True + + False + True True IoC resolve @@ -115,53 +206,86 @@ res True Robust.Shared.IoC.IoCManager.Resolve<$TYPE$>()$END$ - - - - - - - - - - - - - - - - - - - - - - - True - True - cs - FooSystem - True - &Entity System - True - 2 - True - 0 - True - 1 - True - True - InCSharpProjectFile - True - $HEADER$namespace $NAMESPACE$ -{ - [JetBrains.Annotations.UsedImplicitly] - public sealed class $CLASS$ : Robust.Shared.GameObjects.EntitySystem { - public override void Initialize() - { - base.Initialize(); - $END$}} + False + False + True + + -1 + False + + True + + False + + True + True + cs + FooSystem + True + &Entity System + True + getAlphaNumericFileNameWithoutExtension() + 2 + True + fileheader() + 0 + True + fileDefaultNamespace() + 1 + True + True + InCSharpProjectFile + True + $HEADER$namespace $NAMESPACE$; + +/// <summary> +/// $CLASS$ handles... +/// </summary> +public sealed class $CLASS$ : EntitySystem { + /// <inheritdoc/> + public override void Initialize() + { + $END$ + } } + SS14 + True + True + cs + SharedFooComponent + True + &Shared Net Component + True + getAlphaNumericFileNameWithoutExtension() + 2 + True + fileheader() + 0 + True + fileDefaultNamespace() + 1 + True + True + InCSharpProjectFile + True + $HEADER$namespace $NAMESPACE$; + +/// <summary> +/// $CLASS$ is used for... +/// </summary> +public abstract class $CLASS$ : Component { + $END$ +} + +/// <summary> +/// Contains network state for $CLASS$. +/// </summary> +public sealed class $CLASS$State : ComponentState { + public $CLASS$State($CLASS$ component) { + + } +} + SS14 True True Serializable & NetSerializable types @@ -175,6 +299,76 @@ netser True [System.Serializable, Robust.Shared.Serialization.NetSerializable] + True + True + cs + FooPrototype + True + &Inheriting Prototype + True + getAlphaNumericFileNameWithoutExtension() + 2 + True + fileheader() + 0 + True + fileDefaultNamespace() + 1 + True + True + InCSharpProjectFile + True + $HEADER$using Robust.Shared.Prototypes; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; + +namespace $NAMESPACE$; + +/// <summary> +/// $CLASS$ is a prototype for... +/// </summary> +[Prototype($END$)] +public sealed class $CLASS$ : IPrototype, IInheritingPrototype { + /// <inheritdoc/> + [IdDataField] + public string ID { get; } = default!; + + /// <inheritdoc/> + [ParentDataField(typeof(AbstractPrototypeIdSerializer<$CLASS$>))] + public string? Parent { get; } + + /// <inheritdoc/> + [NeverPushInheritance] + [AbstractDataField] + public bool Abstract { get; } +} + SS14 + True + True + cs + FooComponent + True + &Client/Server Net Component + True + getAlphaNumericFileNameWithoutExtension() + 2 + True + fileheader() + 0 + True + fileDefaultNamespace() + 1 + True + True + InCSharpProjectFile + True + $HEADER$namespace $NAMESPACE$; + +/// <inheritdoc/> +[RegisterComponent, NetworkedComponent] +public sealed class $CLASS$ : Shared$CLASS$ { + $END$ +} + SS14 True True True