Class BoundedRectangle
This class defines a rectanglar area, whose position is automatically "locked" to being inside a rectangular bounding box as it is changed. A typical use might be keeping track of a camera's view area.
Inheritance
Implements
Inherited Members
Namespace: GoRogue
Assembly: GoRogue.dll
Syntax
[Serializable]
public class BoundedRectangle : IEquatable<BoundedRectangle>
Constructors
| Improve this Doc View SourceBoundedRectangle(Rectangle, Rectangle)
Constructor.
Declaration
public BoundedRectangle(Rectangle area, Rectangle boundingBox)
Parameters
Type | Name | Description |
---|---|---|
Rectangle | area | Initial area for the rectangle. |
Rectangle | boundingBox | Initial bounding box by which to bound the rectangle. |
Properties
| Improve this Doc View SourceArea
The rectangle that is guaranteed to be contained completely within BoundingBox. Although it does not specifically provide a set accessor, this property is returning a reference and as such may be assigned to.
Declaration
public Rectangle Area { get; }
Property Value
Type | Description |
---|---|
Rectangle |
BoundingBox
The rectangle which Area is automatically bounded to be within. Although this property does not explicitly provide a set accessor, it is returning a reference so therefore the property may be assigned to.
Declaration
public Rectangle BoundingBox { get; }
Property Value
Type | Description |
---|---|
Rectangle |
Methods
| Improve this Doc View SourceEquals(BoundedRectangle)
Compares the current BoundedRectangle to the one given.
Declaration
public bool Equals(BoundedRectangle other)
Parameters
Type | Name | Description |
---|---|---|
BoundedRectangle | other |
Returns
Type | Description |
---|---|
System.Boolean | True if the given BoundedRectangle represents the same area, false otherwise. |
Equals(Object)
Compares the current BoundedRectangle to the object given.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean | True if the given object is a BoundedRectangle that represents the same area, false otherwise. |
Overrides
GetHashCode()
Returns a hash-value for this object.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
Operators
| Improve this Doc View SourceEquality(BoundedRectangle, BoundedRectangle)
Compares the two BoundedRectangle instances.
Declaration
public static bool operator ==(BoundedRectangle lhs, BoundedRectangle rhs)
Parameters
Type | Name | Description |
---|---|---|
BoundedRectangle | lhs | |
BoundedRectangle | rhs |
Returns
Type | Description |
---|---|
System.Boolean | True if the two given BoundedRectangle instances represent the same area, false otherwise. |
Inequality(BoundedRectangle, BoundedRectangle)
Compares the two BoundedRectangle instances.
Declaration
public static bool operator !=(BoundedRectangle lhs, BoundedRectangle rhs)
Parameters
Type | Name | Description |
---|---|---|
BoundedRectangle | lhs | |
BoundedRectangle | rhs |
Returns
Type | Description |
---|---|
System.Boolean | True if the two given BoundedRectangle instances do NOT represent the same area, false otherwise. |