mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-02 01:57:07 +02:00
* 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>
37 lines
1.2 KiB
C#
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
|
|
{
|
|
}
|
|
}
|