1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-23 00:38:47 +00:00

docs/perf: throw for null input

This commit is contained in:
Oliver Booth 2023-04-02 03:12:04 +01:00
parent 3d69cf362d
commit ceaa254d7a
No known key found for this signature in database
GPG Key ID: 20BEB9DC87961025
2 changed files with 13 additions and 1 deletions

View File

@ -206,8 +206,14 @@ public static partial class DebugUtility
/// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing /// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing
/// <see langword="true" /> will have the box be obscured by objects closer to the camera. /// <see langword="true" /> will have the box be obscured by objects closer to the camera.
/// </param> /// </param>
/// <exception cref="ArgumentNullException"><paramref name="polygon" /> is <see langword="null" />.</exception>
public static void DrawPolygon(PolygonF polygon, in Vector3 offset, in Color color, float duration, bool depthTest) public static void DrawPolygon(PolygonF polygon, in Vector3 offset, in Color color, float duration, bool depthTest)
{ {
if (polygon is null)
{
throw new ArgumentNullException(nameof(polygon));
}
IReadOnlyList<PointF> points = polygon.Vertices; IReadOnlyList<PointF> points = polygon.Vertices;
if (points.Count < 2) if (points.Count < 2)
{ {

View File

@ -1,4 +1,4 @@
using UnityEngine; using UnityEngine;
using X10D.Drawing; using X10D.Drawing;
using X10D.Unity.Numerics; using X10D.Unity.Numerics;
@ -103,8 +103,14 @@ public static partial class DebugUtility
/// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing /// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing
/// <see langword="true" /> will have the box be obscured by objects closer to the camera. /// <see langword="true" /> will have the box be obscured by objects closer to the camera.
/// </param> /// </param>
/// <exception cref="ArgumentNullException"><paramref name="polyhedron" /> is <see langword="null" />.</exception>
public static void DrawPolyhedron(Polyhedron polyhedron, in Vector3 offset, in Color color, float duration, bool depthTest) public static void DrawPolyhedron(Polyhedron polyhedron, in Vector3 offset, in Color color, float duration, bool depthTest)
{ {
if (polyhedron is null)
{
throw new ArgumentNullException(nameof(polyhedron));
}
IReadOnlyList<System.Numerics.Vector3> points = polyhedron.Vertices; IReadOnlyList<System.Numerics.Vector3> points = polyhedron.Vertices;
if (points.Count < 2) if (points.Count < 2)
{ {