Table of Contents

Class ObjectExtensions

Namespace
Gamelogic.Extensions
Assembly
Assembly-CSharp.dll

Provides extensions for objects.

[Version(1, 4, 0)]
public static class ObjectExtensions
Inheritance
ObjectExtensions
Inherited Members

Methods

ThrowIfNegative(int, string)

Throws a ArgumentOutOfRange exception if the integer is negative.

[Version(1, 4, 1)]
public static void ThrowIfNegative(this int n, string name)

Parameters

n int

The integer to check.

name string

The name of the variable.

Exceptions

ArgumentOutOfRangeException

ThrowIfNegative(float, string)

Throws a ArgumentOutOfRange exception if the float is negative.

[Version(1, 4, 1)]
public static void ThrowIfNegative(float x, string name)

Parameters

x float

The float to check.

name string

The name of the variable.

Exceptions

ArgumentOutOfRangeException

ThrowIfNull(object, string)

Throws a NullReferenceException if the object is null.

public static void ThrowIfNull(this object o, string name)

Parameters

o object

An object to check.

name string

The name of the variable this methods is called on.

Exceptions

NullReferenceException