[arkit] Add ARAnchorCopying protocol (#4523)
Even if empty this protocol will help with tests and subclasses.
This commit is contained in:
Родитель
65b1d0cfb5
Коммит
839c26e21d
11
src/arkit.cs
11
src/arkit.cs
|
@ -144,11 +144,20 @@ namespace ARKit {
|
||||||
Mapped,
|
Mapped,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[iOS (12,0)]
|
||||||
|
[NoWatch, NoTV, NoMac]
|
||||||
|
[Protocol]
|
||||||
|
[Advice ("To conform to 'ARAnchorCopying' you need to implement:\n'[Export (\"initWithAnchor:\")]'\n'public YourConstructor (ARAnchor anchor)'")]
|
||||||
|
interface ARAnchorCopying : NSCopying {
|
||||||
|
// Constructors in interfaces are not possible in C#
|
||||||
|
// @required -(instancetype _Nonnull)initWithAnchor:(ARAnchor * _Nonnull)anchor;
|
||||||
|
}
|
||||||
|
|
||||||
[iOS (11,0)]
|
[iOS (11,0)]
|
||||||
[NoWatch, NoTV, NoMac]
|
[NoWatch, NoTV, NoMac]
|
||||||
[BaseType (typeof (NSObject))]
|
[BaseType (typeof (NSObject))]
|
||||||
[DisableDefaultCtor]
|
[DisableDefaultCtor]
|
||||||
interface ARAnchor : NSCopying, NSSecureCoding {
|
interface ARAnchor : ARAnchorCopying, NSSecureCoding {
|
||||||
|
|
||||||
[NullAllowed, Export ("identifier")]
|
[NullAllowed, Export ("identifier")]
|
||||||
NSUuid Identifier { get; }
|
NSUuid Identifier { get; }
|
||||||
|
|
|
@ -62,6 +62,10 @@ namespace Introspection
|
||||||
return SkipAllowed (methodName.DeclaringType.Name, methodName.Name, typo);
|
return SkipAllowed (methodName.DeclaringType.Name, methodName.Name, typo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readonly HashSet<string> allowedRule3 = new HashSet<string> {
|
||||||
|
"IARAnchorCopying", // We're showing a code snippet in the 'Advice' message and that shouldn't end with a dot.
|
||||||
|
};
|
||||||
|
|
||||||
HashSet<string> allowedMemberRule4 = new HashSet<string> {
|
HashSet<string> allowedMemberRule4 = new HashSet<string> {
|
||||||
"Platform",
|
"Platform",
|
||||||
"PlatformHelper",
|
"PlatformHelper",
|
||||||
|
@ -944,8 +948,10 @@ namespace Introspection
|
||||||
|
|
||||||
// Rule 3: https://github.com/xamarin/xamarin-macios/wiki/BINDINGS#rule-3
|
// Rule 3: https://github.com/xamarin/xamarin-macios/wiki/BINDINGS#rule-3
|
||||||
if (!message.EndsWith (".", StringComparison.Ordinal)) {
|
if (!message.EndsWith (".", StringComparison.Ordinal)) {
|
||||||
ReportError ("[Rule 3] Missing '.' in attribute's message: \"{0}\" - {1}", message, memberAndType);
|
if (!allowedRule3.Contains (typeName)) {
|
||||||
totalErrors++;
|
ReportError ("[Rule 3] Missing '.' in attribute's message: \"{0}\" - {1}", message, memberAndType);
|
||||||
|
totalErrors++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rule 4: https://github.com/xamarin/xamarin-macios/wiki/BINDINGS#rule-4
|
// Rule 4: https://github.com/xamarin/xamarin-macios/wiki/BINDINGS#rule-4
|
||||||
|
|
|
@ -5,7 +5,3 @@
|
||||||
!wrong-simd-missing-marshaldirective! System.IntPtr ARKit.ARPlaneGeometry::GetRawTextureCoordinates(): simd type: simd_float2
|
!wrong-simd-missing-marshaldirective! System.IntPtr ARKit.ARPlaneGeometry::GetRawTextureCoordinates(): simd type: simd_float2
|
||||||
!wrong-simd-missing-marshaldirective! System.IntPtr ARKit.ARPlaneGeometry::GetRawVertices(): simd type: simd_float3
|
!wrong-simd-missing-marshaldirective! System.IntPtr ARKit.ARPlaneGeometry::GetRawVertices(): simd type: simd_float3
|
||||||
!wrong-simd-missing-marshaldirective! System.IntPtr ARKit.ARPointCloud::GetRawPoints(): simd type: simd_float3
|
!wrong-simd-missing-marshaldirective! System.IntPtr ARKit.ARPointCloud::GetRawPoints(): simd type: simd_float3
|
||||||
|
|
||||||
# Protocol inlined in ARAnchor (constructor in protocol)
|
|
||||||
!missing-protocol! ARAnchorCopying not bound
|
|
||||||
!missing-protocol-conformance! ARAnchor should conform to ARAnchorCopying
|
|
Загрузка…
Ссылка в новой задаче