Files
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

44 lines
1.0 KiB
C#

namespace Sandbox;
/// <summary>
/// Automatically synchronize a property of a networked object from the owner to other clients.
/// </summary>
[AttributeUsage( AttributeTargets.Property )]
[CodeGenerator( CodeGeneratorFlags.Instance | CodeGeneratorFlags.WrapPropertySet, "__sync_SetValue" )]
[CodeGenerator( CodeGeneratorFlags.Instance | CodeGeneratorFlags.WrapPropertyGet, "__sync_GetValue" )]
public class SyncAttribute : Attribute
{
/// <summary>
/// Query this value for changes rather than counting on set being called. This is appropriate
/// if the value returned by its getter can change without calling its setter.
///
/// Obsoleted: 13/12/2024
/// </summary>
[Obsolete( "Use SyncFlags.Query" )]
public bool Query
{
set
{
if ( value )
Flags |= SyncFlags.Query;
else
Flags &= ~SyncFlags.Query;
}
}
/// <summary>
/// Flags that describe how this property is synchronized.
/// </summary>
public SyncFlags Flags { get; set; }
public SyncAttribute( SyncFlags flags )
{
Flags = flags;
}
public SyncAttribute()
{
}
}