From 0d0ce72cb28d0fac434ec59de764a4ee59555814 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Tue, 29 Nov 2022 23:59:26 +0000 Subject: [PATCH] Rename Object properties to more specific names This avoids problems with the type name Object, which is a keyword in VB and other languages --- VpSharp/src/EventData/ObjectBumpEventArgs.cs | 8 ++++---- .../src/EventData/ObjectChangedEventArgs.cs | 12 ++++++------ .../src/EventData/ObjectClickedEventArgs.cs | 18 +++++++++--------- .../src/EventData/ObjectCreatedEventArgs.cs | 8 ++++---- .../src/EventData/ObjectDeletedEventArgs.cs | 10 +++++----- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/VpSharp/src/EventData/ObjectBumpEventArgs.cs b/VpSharp/src/EventData/ObjectBumpEventArgs.cs index 5bcae51..30fbc9d 100644 --- a/VpSharp/src/EventData/ObjectBumpEventArgs.cs +++ b/VpSharp/src/EventData/ObjectBumpEventArgs.cs @@ -11,12 +11,12 @@ public sealed class ObjectBumpEventArgs : EventArgs /// Initializes a new instance of the class. /// /// The avatar. - /// The object. + /// The bumped object. /// The bump phase. - public ObjectBumpEventArgs(VirtualParadiseAvatar avatar, VirtualParadiseObject virtualParadiseObject, BumpPhase phase) + public ObjectBumpEventArgs(VirtualParadiseAvatar avatar, VirtualParadiseObject bumpedObject, BumpPhase phase) { Avatar = avatar; - Object = virtualParadiseObject; + BumpedObject = bumpedObject; Phase = phase; } @@ -30,7 +30,7 @@ public sealed class ObjectBumpEventArgs : EventArgs /// Gets the object to which this event pertains. /// /// The object to which this event pertains. - public VirtualParadiseObject Object { get; } + public VirtualParadiseObject BumpedObject { get; } /// /// Gets the bump phase. diff --git a/VpSharp/src/EventData/ObjectChangedEventArgs.cs b/VpSharp/src/EventData/ObjectChangedEventArgs.cs index b54663c..dc9ad31 100644 --- a/VpSharp/src/EventData/ObjectChangedEventArgs.cs +++ b/VpSharp/src/EventData/ObjectChangedEventArgs.cs @@ -12,14 +12,14 @@ public sealed class ObjectChangedEventArgs : EventArgs /// /// The avatar which changed the object. /// The state of the object prior to the change. - /// The object which was changed, containing updated values. + /// The object which was changed, containing updated values. public ObjectChangedEventArgs( VirtualParadiseAvatar avatar, - VirtualParadiseObject objectBefore, - VirtualParadiseObject virtualParadiseObject) + VirtualParadiseObject? objectBefore, + VirtualParadiseObject objectAfter) { Avatar = avatar; - Object = virtualParadiseObject; + ObjectAfter = objectAfter; ObjectBefore = objectBefore; } @@ -34,7 +34,7 @@ public sealed class ObjectChangedEventArgs : EventArgs /// /// The object which was changed. /// This instance will contain the updated values of the object. - public VirtualParadiseObject Object { get; } + public VirtualParadiseObject ObjectAfter { get; } /// /// Gets the state of the object prior to the change. @@ -43,5 +43,5 @@ public sealed class ObjectChangedEventArgs : EventArgs /// The state of the object prior to the change. This value may be if the client did not /// previously have the object cached. /// - public VirtualParadiseObject ObjectBefore { get; } + public VirtualParadiseObject? ObjectBefore { get; } } diff --git a/VpSharp/src/EventData/ObjectClickedEventArgs.cs b/VpSharp/src/EventData/ObjectClickedEventArgs.cs index cc51513..031bc64 100644 --- a/VpSharp/src/EventData/ObjectClickedEventArgs.cs +++ b/VpSharp/src/EventData/ObjectClickedEventArgs.cs @@ -11,15 +11,15 @@ public sealed class ObjectClickedEventArgs : EventArgs /// Initializes a new instance of the class. /// /// The avatar responsible for the click. - /// The clicked object. + /// The clicked object. /// The click point. public ObjectClickedEventArgs( VirtualParadiseAvatar avatar, - VirtualParadiseObject virtualParadiseObject, + VirtualParadiseObject clickedObject, Vector3d clickPoint) { Avatar = avatar; - Object = virtualParadiseObject; + ClickedObject = clickedObject; ClickPoint = clickPoint; } @@ -29,15 +29,15 @@ public sealed class ObjectClickedEventArgs : EventArgs /// The avatar responsible for the click. public VirtualParadiseAvatar Avatar { get; } + /// + /// Gets the clicked object. + /// + /// The clicked object. + public VirtualParadiseObject ClickedObject { get; } + /// /// Gets the point at which the avatar clicked the object. /// /// The click point. public Vector3d ClickPoint { get; } - - /// - /// Gets the clicked object. - /// - /// The clicked object. - public VirtualParadiseObject Object { get; } } diff --git a/VpSharp/src/EventData/ObjectCreatedEventArgs.cs b/VpSharp/src/EventData/ObjectCreatedEventArgs.cs index 337105d..ccdab38 100644 --- a/VpSharp/src/EventData/ObjectCreatedEventArgs.cs +++ b/VpSharp/src/EventData/ObjectCreatedEventArgs.cs @@ -11,11 +11,11 @@ public sealed class ObjectCreatedEventArgs : EventArgs /// Initializes a new instance of the class. /// /// The avatar responsible for the object being created. - /// The created object. - public ObjectCreatedEventArgs(VirtualParadiseAvatar avatar, VirtualParadiseObject virtualParadiseObject) + /// The created object. + public ObjectCreatedEventArgs(VirtualParadiseAvatar avatar, VirtualParadiseObject createdObject) { Avatar = avatar; - Object = virtualParadiseObject; + CreatedObject = createdObject; } /// @@ -28,5 +28,5 @@ public sealed class ObjectCreatedEventArgs : EventArgs /// Gets the object which was created. /// /// The object which was created. - public VirtualParadiseObject Object { get; } + public VirtualParadiseObject CreatedObject { get; } } diff --git a/VpSharp/src/EventData/ObjectDeletedEventArgs.cs b/VpSharp/src/EventData/ObjectDeletedEventArgs.cs index 1300958..7e18f20 100644 --- a/VpSharp/src/EventData/ObjectDeletedEventArgs.cs +++ b/VpSharp/src/EventData/ObjectDeletedEventArgs.cs @@ -12,12 +12,12 @@ public sealed class ObjectDeletedEventArgs : EventArgs /// /// The avatar responsible for the object being deleted. /// The ID of the deleted object. - /// The deleted object. - public ObjectDeletedEventArgs(VirtualParadiseAvatar avatar, int objectId, VirtualParadiseObject virtualParadiseObject) + /// The deleted object. + public ObjectDeletedEventArgs(VirtualParadiseAvatar avatar, int objectId, VirtualParadiseObject deletedObject) { Avatar = avatar; ObjectId = objectId; - Object = virtualParadiseObject; + DeletedObject = deletedObject; } /// @@ -35,7 +35,7 @@ public sealed class ObjectDeletedEventArgs : EventArgs /// will always be assigned. /// /// - public VirtualParadiseObject Object { get; } + public VirtualParadiseObject DeletedObject { get; } /// /// Gets the ID of the object which was deleted. @@ -44,6 +44,6 @@ public sealed class ObjectDeletedEventArgs : EventArgs /// /// This value will always be assigned, regardless of whether or not the client had previously cached the object. /// - /// + /// public int ObjectId { get; } }