From b3af6141a2e97a0d52a17438a2311308857d8e8a Mon Sep 17 00:00:00 2001 From: Raul Santos Date: Tue, 24 Jan 2023 20:03:32 +0100 Subject: C#: Remove `GetArea` and `GetVolume` methods - Remove `GetArea` method in favor of the `Area` property in Rect2{i}. - Replace `GetVolume` method with a `Volume` property in AABB. --- modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs | 20 ++++++++++---------- .../mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs | 15 +++------------ .../mono/glue/GodotSharp/GodotSharp/Core/Rect2I.cs | 15 +++------------ 3 files changed, 16 insertions(+), 34 deletions(-) (limited to 'modules/mono/glue') diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs index 0e92f4331d..af83cc24bf 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs @@ -49,6 +49,15 @@ namespace Godot set { _size = value - _position; } } + /// + /// The volume of this . + /// See also . + /// + public readonly real_t Volume + { + get { return _size.X * _size.Y * _size.Z; } + } + /// /// Returns an with equivalent position and size, modified so that /// the most-negative corner is the origin and the size is positive. @@ -311,15 +320,6 @@ namespace Godot dir.Z > 0f ? -halfExtents.Z : halfExtents.Z); } - /// - /// Returns the volume of the . - /// - /// The volume. - public readonly real_t GetVolume() - { - return _size.X * _size.Y * _size.Z; - } - /// /// Returns a copy of the grown a given amount of units towards all the sides. /// @@ -383,7 +383,7 @@ namespace Godot /// Returns if the has /// area, and if the /// is linear, empty, or has a negative . - /// See also . + /// See also . /// /// /// A for whether or not the has volume. diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs index be4004a0f9..69444f8035 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs @@ -51,11 +51,11 @@ namespace Godot /// /// The area of this . + /// See also . /// - /// Equivalent to . public readonly real_t Area { - get { return GetArea(); } + get { return _size.X * _size.Y; } } /// @@ -160,15 +160,6 @@ namespace Godot return expanded; } - /// - /// Returns the area of the . - /// - /// The area. - public readonly real_t GetArea() - { - return _size.X * _size.Y; - } - /// /// Returns the center of the , which is equal /// to + ( / 2). @@ -247,7 +238,7 @@ namespace Godot /// Returns if the has /// area, and if the /// is linear, empty, or has a negative . - /// See also . + /// See also . /// /// /// A for whether or not the has area. diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2I.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2I.cs index 5b06101db5..2099d0abca 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2I.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2I.cs @@ -51,11 +51,11 @@ namespace Godot /// /// The area of this . + /// See also . /// - /// Equivalent to . public readonly int Area { - get { return GetArea(); } + get { return _size.X * _size.Y; } } /// @@ -150,15 +150,6 @@ namespace Godot return expanded; } - /// - /// Returns the area of the . - /// - /// The area. - public readonly int GetArea() - { - return _size.X * _size.Y; - } - /// /// Returns the center of the , which is equal /// to + ( / 2). @@ -239,7 +230,7 @@ namespace Godot /// Returns if the has /// area, and if the /// is linear, empty, or has a negative . - /// See also . + /// See also . /// /// /// A for whether or not the has area. -- cgit v1.2.3