Show / Hide Table of Contents

Class Radius

Class representing different shapes that define the concept of a radius on a grid. You cannot create instances of this class using a constructor -- instead, this class contains static instances representing the various radius shapes.

Inheritance
System.Object
Radius
Implements
System.IEquatable<Radius>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: GoRogue
Assembly: GoRogue.dll
Syntax
[Serializable]
public class Radius : IEquatable<Radius>
Remarks

Contains utility functions to work with radius shapes. Instances of Radius are also implicitly convertible to both Distance and AdjacencyRule (since both a method of determining adjacent locations and a method of calculating distance are implied by a radius shape).

Fields

| Improve this Doc View Source

CIRCLE

Radius is a circle around the center point. CIRCLE would represent movement radius in an 8-way movement scheme with a ~1.41 cost multiplier for diagonal movement.

Declaration
[NonSerialized]
public static readonly Radius CIRCLE
Field Value
Type Description
Radius
| Improve this Doc View Source

CUBE

Radius is a cube around the center point. Similar to SQUARE in 2d shape.

Declaration
[NonSerialized]
public static readonly Radius CUBE
Field Value
Type Description
Radius
| Improve this Doc View Source

DIAMOND

Radius is a diamond around the center point. DIAMOND would represent movement radius in a 4-way movement scheme.

Declaration
[NonSerialized]
public static readonly Radius DIAMOND
Field Value
Type Description
Radius
| Improve this Doc View Source

OCTAHEDRON

Radius is an octahedron around the center point. Similar to DIAMOND in 2d shape.

Declaration
[NonSerialized]
public static readonly Radius OCTAHEDRON
Field Value
Type Description
Radius
| Improve this Doc View Source

SPHERE

Radius is a sphere around the center point. Similar to CIRCLE in 2d shape.

Declaration
[NonSerialized]
public static readonly Radius SPHERE
Field Value
Type Description
Radius
| Improve this Doc View Source

SQUARE

Radius is a square around the center point. SQUARE would represent movement radius in an 8-way movement scheme, where all 8 squares around an item are considered equal distance away.

Declaration
[NonSerialized]
public static readonly Radius SQUARE
Field Value
Type Description
Radius
| Improve this Doc View Source

Type

Enum value representing the radius shape -- useful for using Radius types in switch statements.

Declaration
public readonly Radius.Types Type
Field Value
Type Description
Radius.Types

Methods

| Improve this Doc View Source

Equals(Radius)

Compares the current Radius to the one given.

Declaration
public bool Equals(Radius other)
Parameters
Type Name Description
Radius other
Returns
Type Description
System.Boolean

True if the given Radius has the same Type, false otherwise.

| Improve this Doc View Source

Equals(Object)

Compares the current Radius 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 Radius with the same Type, false otherwise.

Overrides
System.Object.Equals(System.Object)
| Improve this Doc View Source

GetHashCode()

Returns a hash-value for this object.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
System.Object.GetHashCode()
| Improve this Doc View Source

ToRadius(Radius.Types)

Gets the Radius class instance representing the radius type specified.

Declaration
public static Radius ToRadius(Radius.Types radiusType)
Parameters
Type Name Description
Radius.Types radiusType

The enum value for the radius shape.

Returns
Type Description
Radius

The radius class representing the given radius shape.

| Improve this Doc View Source

ToString()

Returns a string representation of the Radius.

Declaration
public override string ToString()
Returns
Type Description
System.String

A string representation of the Radius.

Overrides
System.Object.ToString()

Operators

| Improve this Doc View Source

Equality(Radius, Radius)

Compares the two Radius instances.

Declaration
public static bool operator ==(Radius lhs, Radius rhs)
Parameters
Type Name Description
Radius lhs
Radius rhs
Returns
Type Description
System.Boolean

True if the two given Radius instances have the same Type, false otherwise.

| Improve this Doc View Source

Implicit(Radius to AdjacencyRule)

Allows implicit casting to the AdjacencyRule type.

Declaration
public static implicit operator AdjacencyRule(Radius radius)
Parameters
Type Name Description
Radius radius

Radius type being casted.

Returns
Type Description
AdjacencyRule
Remarks

The rule corresponding to the proper definition of distance that creates the radius shape casted will be returned.

| Improve this Doc View Source

Implicit(Radius to Distance)

Allows implicit casting to the Distance type.

Declaration
public static implicit operator Distance(Radius radius)
Parameters
Type Name Description
Radius radius

Radius type being casted.

Returns
Type Description
Distance
Remarks

The Distance instance corresponding to the proper definition of distance that creates the radius shape casted will be returned.

| Improve this Doc View Source

Inequality(Radius, Radius)

Compares the two Radius instances.

Declaration
public static bool operator !=(Radius lhs, Radius rhs)
Parameters
Type Name Description
Radius lhs
Radius rhs
Returns
Type Description
System.Boolean

True if the two given Radius instances do NOT have the same Type, false otherwise.

Implements

System.IEquatable<T>

Extension Methods

Utility.Yield<T>(T)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX