Table of Contents

Struct Size

Namespace
BSGameLib.Game.Drawing
Assembly
BSGameLib.Game.dll

A width and a height.

public struct Size : IEquatable<Size>
Implements
Inherited Members

Constructors

Size(int, int)

Creates a size with the given width and height.

public Size(int width, int height)

Parameters

width int
height int

Properties

Height

The height.

public int Height { readonly get; set; }

Property Value

int

Width

The width.

public int Width { readonly get; set; }

Property Value

int

Methods

Equals(Size)

Whether other has the same width and height.

public readonly bool Equals(Size other)

Parameters

other Size

Returns

bool

Equals(object)

Whether obj is a Size with the same width and height.

public override readonly bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

Returns a hash code based on the width and height, consistent with Equals(object).

public override readonly int GetHashCode()

Returns

int

ToString()

Returns the size as (Width, Height).

public override readonly string ToString()

Returns

string

Operators

operator +(Size, Size)

Adds the widths and the heights of the two sizes.

public static Size operator +(Size a, Size b)

Parameters

a Size
b Size

Returns

Size

operator /(Size, Size)

Divides the widths and the heights of a by those of b, using integer division. Throws DivideByZeroException when a component of b is zero.

public static Size operator /(Size a, Size b)

Parameters

a Size
b Size

Returns

Size

operator ==(Size, Size)

Whether the two sizes have the same width and height.

public static bool operator ==(Size a, Size b)

Parameters

a Size
b Size

Returns

bool

operator !=(Size, Size)

Whether the two sizes differ in width or height.

public static bool operator !=(Size a, Size b)

Parameters

a Size
b Size

Returns

bool

operator *(Size, Size)

Multiplies the widths and the heights of the two sizes.

public static Size operator *(Size a, Size b)

Parameters

a Size
b Size

Returns

Size

operator -(Size, Size)

Subtracts the widths and the heights of b from those of a.

public static Size operator -(Size a, Size b)

Parameters

a Size
b Size

Returns

Size