Content PR for auto-componentstate sourcegen (#14845)

* Content PR for auto-componentstate sourcegen

# Conflicts:
#	Content.Shared/Chat/TypingIndicator/TypingIndicatorComponent.cs
#	Content.Shared/Content.Shared.csproj
#	SpaceStation14.sln

* shared file too

* afterautohandlestate example

* oops

* anudda

* access fixed

* smart
This commit is contained in:
Kara
2023-04-06 10:33:40 -07:00
committed by GitHub
parent b943d83ae1
commit 9688544e78
6 changed files with 23 additions and 64 deletions

View File

@@ -6,28 +6,18 @@ using Robust.Shared.Serialization;
namespace Content.Shared.Access.Components
{
[RegisterComponent, NetworkedComponent]
[AutoGenerateComponentState]
[Access(typeof(SharedIdCardSystem), typeof(SharedPDASystem), typeof(SharedAgentIdCardSystem))]
public sealed class IdCardComponent : Component
public sealed partial class IdCardComponent : Component
{
[DataField("fullName")]
[AutoNetworkedField]
[Access(typeof(SharedIdCardSystem), typeof(SharedPDASystem), typeof(SharedAgentIdCardSystem),
Other = AccessPermissions.ReadWrite)] // FIXME Friends
public string? FullName;
[DataField("jobTitle")]
[AutoNetworkedField]
public string? JobTitle;
}
[Serializable, NetSerializable]
public sealed class IdCardComponentState : ComponentState
{
public string? FullName;
public string? JobTitle;
public IdCardComponentState(string? fullName, string? jobTitle)
{
FullName = fullName;
JobTitle = jobTitle;
}
}
}