mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-08-01 08:18:20 -04:00
* Move all unit tests to Engine/Tests * Fix Margin.EdgeSubtract * Fix Capsule.Contains * EnvironmentVariables.Remove if it's null * Fixed ray trace never returning startedsolid * Fix HistoryList.Navigate on empty list * Fix GameObject.WorldPosition accepting NaNs * Fix flex: initial expanding to the wrong grow/shrink * Translation.TryConvert shouldn't throw on invalid enum strings * Skip sound file tests on machines with no audio device
51 lines
870 B
C#
51 lines
870 B
C#
using Sandbox;
|
|
using System;
|
|
|
|
[AttributeUsage( AttributeTargets.Property )]
|
|
[CodeGenerator( CodeGeneratorFlags.WrapPropertySet | CodeGeneratorFlags.Instance, "OnWrapSet" )]
|
|
[CodeGenerator( CodeGeneratorFlags.WrapPropertySet | CodeGeneratorFlags.Static, "WrapSet.OnWrapSetStatic" )]
|
|
public class WrapSet : Attribute
|
|
{
|
|
public static void OnWrapSetStatic<T>( WrappedPropertySet<T> p )
|
|
{
|
|
|
|
}
|
|
}
|
|
|
|
public partial class TestWrapSet
|
|
{
|
|
[WrapSet]
|
|
public static bool StaticProperty { get; set; }
|
|
|
|
[WrapSet]
|
|
public bool InstanceProperty { set; }
|
|
|
|
internal void OnWrapSet<T>( WrappedPropertySet<T> p )
|
|
{
|
|
return null;
|
|
}
|
|
|
|
[WrapSet]
|
|
public bool HasNoSetterToWrap
|
|
{
|
|
get => true;
|
|
}
|
|
|
|
[WrapSet]
|
|
public bool FieldKeywordProperty
|
|
{
|
|
set
|
|
{
|
|
field = value;
|
|
}
|
|
get => field;
|
|
}
|
|
|
|
[WrapSet]
|
|
public bool FieldKeywordPropertyAuto
|
|
{
|
|
set;
|
|
get => field;
|
|
}
|
|
}
|