Skip to content

Commit

Permalink
Update all usages of DataFieldAttribute to not include the optional tag
Browse files Browse the repository at this point in the history
  • Loading branch information
DrSmugleaf committed Nov 28, 2023
1 parent 574fdaa commit 435d8b7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/en/space-station-14/destructible.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public partial class DamageTrigger : IThresholdTrigger
/// <summary>
/// The amount of damage at which this threshold will trigger.
/// </summary>
[DataField("damage")]
[DataField]
public int Damage { get; set; }
public bool Reached(IDamageableComponent damageable, DestructibleSystem system)
Expand All @@ -60,7 +60,7 @@ public partial class PlaySoundBehavior : IThresholdBehavior
/// <summary>
/// Sound played upon destruction.
/// </summary>
[DataField("sound")]
[DataField]
public string Sound { get; set; } = string.Empty;
public void Execute(IEntity owner, DestructibleSystem system)
Expand Down
2 changes: 1 addition & 1 deletion src/en/ss14-by-example/adding-a-simple-bikehorn.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ namespace Content.Server.Sound
[RegisterComponent]
public sealed partial class PlaySoundOnUseComponent : Component
{
[DataField("sound")]
[DataField]
public string Sound = string.Empty;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/en/ss14-by-example/basic-networking-and-you.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ An example of all of the networking code required for IDCardComponent now, from
[Access(typeof(SharedIdCardSystem), typeof(SharedPDASystem), typeof(SharedAgentIdCardSystem))]
public sealed partial class IdCardComponent : Component
{
[DataField("fullName")]
[DataField]
[AutoNetworkedField]
[Access(typeof(SharedIdCardSystem), typeof(SharedPDASystem), typeof(SharedAgentIdCardSystem),
Other = AccessPermissions.ReadWrite)] // FIXME Friends
public string? FullName;

[DataField("jobTitle")]
[DataField]
[AutoNetworkedField]
public string? JobTitle;
}
Expand Down Expand Up @@ -323,4 +323,4 @@ This isn't going to be a super low-level overview of it or anything, but basical

It's quite slow, but it's multithreaded and miles faster than the BYOND equivalent--fast enough to get us >250 players on 20 ticks-per-second, so it's good enough.

As for what this means to you and your code, note that in testing you won't receive states for entities that are too far away, and you may need to think about the special case of what happens when entities go in and out of range, though you don't usually need to worry about it.
As for what this means to you and your code, note that in testing you won't receive states for entities that are too far away, and you may need to think about the special case of what happens when entities go in and out of range, though you don't usually need to worry about it.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ Here's the full visualizer we're porting:
[UsedImplicitly]
public class ItemCabinetVisualizer : AppearanceVisualizer
{
[DataField("openState", required: true)]
[DataField(required: true)]
private string _openState = default!;

[DataField("closedState", required: true)]
[DataField(required: true)]
private string _closedState = default!;

public override void OnChangeData(AppearanceComponent component)
Expand Down Expand Up @@ -45,10 +45,10 @@ Component:
[RegisterComponent]
public sealed class ItemCabinetVisualsComponent : Component
{
[DataField("openState", required: true)]
[DataField(required: true)]
private string _openState = default!;

[DataField("closedState", required: true)]
[DataField(required: true)]
private string _closedState = default!;
}
```
Expand Down Expand Up @@ -91,10 +91,10 @@ So it'll look like this now:
[RegisterComponent]
public sealed class ItemCabinetVisualsComponent : Component
{
[DataField("openState", required: true)]
[DataField(required: true)]
public string OpenState = default!;

[DataField("closedState", required: true)]
[DataField(required: true)]
public string ClosedState = default!;
}
```
Expand Down

0 comments on commit 435d8b7

Please sign in to comment.