Files
RobustToolbox/Robust.Shared/Serialization/Manager/Attributes/AlwaysPushInheritanceAttribute.cs
4747e5a05a Add and update a lot of documentation (#6337)
* Serialization docs

Co-authored-by: Moony <moonheart08@users.noreply.github.com>

* ECS docs

Co-authored-by: Moony <moonheart08@users.noreply.github.com>

* scattered docs

Co-authored-by: Moony <moonheart08@users.noreply.github.com>

* Fixes

---------

Co-authored-by: Moony <moonheart08@users.noreply.github.com>
Co-authored-by: PJB3005 <pieterjan.briers+git@gmail.com>
2025-12-15 20:26:17 +01:00

37 lines
1.2 KiB
C#

using System;
namespace Robust.Shared.Serialization.Manager.Attributes
{
/// <summary>
/// When inheriting a field from a parent, always <b>merge</b> the two fields when such behavior exists.
/// This is unlike the normal behavior where the child's field will always <b>overwrite</b> the parent's.
/// <br/>
/// Merging is done at a YAML level by merging mappings and sequences recursively.
/// </summary>
/// <example>
/// <code>
/// - id: Parent
/// myField: [Foo, Bar]
/// <br/>
/// - id: Child
/// parents: [Parent]
/// myField: [Baz, Qux]
/// </code>
/// Which, when deserialized and assuming myField is marked with AlwaysPushInheritance, will result in data that
/// looks like this:
/// <code>
/// - id: Child
/// myField: [Foo, Bar, Baz, Qux]
/// </code>
/// compared to the default behavior:
/// <code>
/// - id: Child
/// myField: [Baz, Qux]
/// </code>
/// </example>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
public sealed class AlwaysPushInheritanceAttribute : Attribute
{
}
}