Quantity<T>


Declaration

[Serializable]
public struct Quantity<T> : IEquatable<Quantity<T>> where T : IEquatable<T>

Description

Stores a quantity of a given entity type.

Type Parameters

TThe type of entity being counted.

Properties

entityThe entity being counted.
amountThe number of entities.

Constructors

QuantityCreates a new quantity with the specified amount of a given entity.

Methods

EqualsDetermines if the quantity is equal to another quantity.
GetHashCodeReturns the hash code of the quantity.
ToStringConverts the quantity to a string.

Operators

EqualityDetermines if two quantities are equal.
InequalityDetermines if two quantities are not equal.