using System;
namespace RecrownedAthenaeum.SpecialTypes
{
///
/// Holds a width and height while allowing for easier comparison between other s.
///
public struct Resolution : IComparable
{
///
/// Dimensions of resolution.
///
public int Width, Height;
///
/// Constructs resolution given the dimensions.
///
/// Width of resolution.
/// Height of resolution.
public Resolution(int width, int height)
{
Width = width;
Height = height;
}
///
/// Compares area of this resolution to another.
///
/// The other resolution to compare to.
/// A value less than 0 for this being the smaller resolution, 0 for the two being the same in area, and larger for this being the larger in area.
public int CompareTo(Resolution other)
{
return Area() - other.Area();
}
///
/// Gets a string representation of this resolution.
///
/// "WidthxHeight"
public override string ToString()
{
return Width + "x" + Height;
}
///
/// Calculates area of resolution.
///
/// Area of resolution.
public int Area()
{
return Width * Height;
}
}
}