Struct Index2
Struktur zur Definierung einer zweidimensionalen Index-Position.
Namespace: OctoAwesome
Assembly: OctoAwesome.dll
Syntax
public struct Index2
Konstructoren
Index2(Index2)
Initialisierung
Deklaration
public Index2(Index2 value)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index2 | value | Initialwerte |
Index2(Index3)
Initialisierung
Deklaration
public Index2(Index3 value)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index3 | value | Initialwerte (X und Y Anteil wird übernommen) |
Index2(Int32, Int32)
Initialisierung
Deklaration
public Index2(int x, int y)
Parameter
Typ | Name | Beschreibung |
---|---|---|
System.Int32 | x | X Anteil |
System.Int32 | y | Y Anteil |
Felder
X
X Anteil
Deklaration
public int X
Wert des Feldes
Typ | Beschreibung |
---|---|
System.Int32 |
Y
Y Anteil
Deklaration
public int Y
Wert des Feldes
Typ | Beschreibung |
---|---|
System.Int32 |
Eigenschaften
One
Index(1,1)
Deklaration
public static Index2 One { get; }
Wert der Eigenschaft
Typ | Beschreibung |
---|---|
Index2 |
UnitX
Einheitsindex für X
Deklaration
public static Index2 UnitX { get; }
Wert der Eigenschaft
Typ | Beschreibung |
---|---|
Index2 |
UnitY
Einheitsindex für Y
Deklaration
public static Index2 UnitY { get; }
Wert der Eigenschaft
Typ | Beschreibung |
---|---|
Index2 |
Zero
Null-Index
Deklaration
public static Index2 Zero { get; }
Wert der Eigenschaft
Typ | Beschreibung |
---|---|
Index2 |
Methoden
Equals(Object)
Überprüft, ob das gegebene Objekt (falls ein Index2 gleich der aktuellen Instanz ist.
Deklaration
public override bool Equals(object obj)
Parameter
Typ | Name | Beschreibung |
---|---|---|
System.Object | obj |
R�ckgabewert
Typ | Beschreibung |
---|---|
System.Boolean |
GetHashCode()
Gibt einen möglichst eindeutigen Hashwert für den aktuellen Index2 zurück.
Deklaration
public override int GetHashCode()
R�ckgabewert
Typ | Beschreibung |
---|---|
System.Int32 |
Length()
Ermittelt die Entferung zum Nullpunkt.
Deklaration
public double Length()
R�ckgabewert
Typ | Beschreibung |
---|---|
System.Double |
LengthSquared()
Ermittelt die Entfernung zum Nullpunkt im Quadrat.
Deklaration
public int LengthSquared()
R�ckgabewert
Typ | Beschreibung |
---|---|
System.Int32 |
NormalizeAxis(Int32, Int32)
Normalisiert einen Integer auf die angegebene Maximalgröße.
Deklaration
public static int NormalizeAxis(int value, int size)
Parameter
Typ | Name | Beschreibung |
---|---|---|
System.Int32 | value | Wert |
System.Int32 | size | Normalisierungsgröße |
R�ckgabewert
Typ | Beschreibung |
---|---|
System.Int32 |
NormalizeX(Index2)
Normalisiert die X-Achse auf die angegebene Größe.
Deklaration
public void NormalizeX(Index2 size)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index2 | size | 2D-Größe (X-Anzeil wird genommen) |
NormalizeX(Index3)
Normalisiert die X-Achse auf die angegebene Größe.
Deklaration
public void NormalizeX(Index3 size)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index3 | size | 3D-Größe (X-Anzeil wird genommen) |
NormalizeX(Int32)
Normalisiert die X-Achse auf die angegebene Größe.
Deklaration
public void NormalizeX(int size)
Parameter
Typ | Name | Beschreibung |
---|---|---|
System.Int32 | size | Maximalwert für X |
NormalizeXY(Index2)
Normalisiert den Wert von X und Y auf den angegebenen Grenzbereich.
Deklaration
public void NormalizeXY(Index2 size)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index2 | size | 2D Size |
NormalizeXY(Index2, Index3)
Normalisiert den Wert von X und Y auf den angegebenen Grenzbereich.
Deklaration
public static Index2 NormalizeXY(Index2 index, Index3 size)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index2 | index | Der zu normalisierende Index2 |
Index3 | size | 3D Size |
R�ckgabewert
Typ | Beschreibung |
---|---|
Index2 |
NormalizeXY(Index3)
Normalisiert den Wert von X und Y auf den angegebenen Grenzbereich.
Deklaration
public void NormalizeXY(Index3 size)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index3 | size | 3D Size |
NormalizeXY(Int32, Int32)
Normalisiert den Wert von X und Y auf den angegebenen Grenzbereich.
Deklaration
public void NormalizeXY(int x, int y)
Parameter
Typ | Name | Beschreibung |
---|---|---|
System.Int32 | x | Größe in X-Richtung |
System.Int32 | y | Größe in Y-Richtung |
NormalizeY(Index2)
Normalisiert die Y-Achse auf die angegebene Größe.
Deklaration
public void NormalizeY(Index2 size)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index2 | size | 2D-Größe (Y-Anzeil wird genommen) |
NormalizeY(Index3)
Normalisiert die Y-Achse auf die angegebene Größe.
Deklaration
public void NormalizeY(Index3 size)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index3 | size | 3D-Größe (Y-Anzeil wird genommen) |
NormalizeY(Int32)
Normalisiert die Y-Achse auf die angegebene Größe.
Deklaration
public void NormalizeY(int size)
Parameter
Typ | Name | Beschreibung |
---|---|---|
System.Int32 | size | Maximalwert für Y |
ShortestDistanceOnAxis(Int32, Int32, Int32)
Ermittelt die kürzeste Entfernung von Ursprung zum Ziel auf einer normalisierten Achse.
Deklaration
public static int ShortestDistanceOnAxis(int origin, int destination, int size)
Parameter
Typ | Name | Beschreibung |
---|---|---|
System.Int32 | origin | Ursprungswert |
System.Int32 | destination | Zielwert |
System.Int32 | size | Normalisierungsgröße |
R�ckgabewert
Typ | Beschreibung |
---|---|
System.Int32 |
ShortestDistanceX(Int32, Int32)
Ermittelt die kürzeste Entfernung zum Ziel auf einer normalisierten X-Achse.
Deklaration
public int ShortestDistanceX(int x, int size)
Parameter
Typ | Name | Beschreibung |
---|---|---|
System.Int32 | x | Ziel |
System.Int32 | size | Normalisierungsgröße |
R�ckgabewert
Typ | Beschreibung |
---|---|
System.Int32 | Entfernung |
ShortestDistanceXY(Index2, Index2)
Ermittelt die kürzeste Entfernung zum Ziel auf den normalisierten Achsen.
Deklaration
public Index2 ShortestDistanceXY(Index2 destination, Index2 size)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index2 | destination | Ziel |
Index2 | size | Normalisierungsgröße |
R�ckgabewert
Typ | Beschreibung |
---|---|
Index2 | Entfernung |
ShortestDistanceY(Int32, Int32)
Ermittelt die kürzeste Entfernung zum Ziel auf einer normalisierten Y-Achse.
Deklaration
public int ShortestDistanceY(int y, int size)
Parameter
Typ | Name | Beschreibung |
---|---|---|
System.Int32 | y | Ziel |
System.Int32 | size | Normalisierungsgröße |
R�ckgabewert
Typ | Beschreibung |
---|---|
System.Int32 | Entfernung |
ToString()
Gibt einen string zurück, der den akteullen Index2 darstellt.
Deklaration
public override string ToString()
R�ckgabewert
Typ | Beschreibung |
---|---|
System.String |
Operatoren
Addition(Index2, Index2)
Addition von zwei Indices2
Deklaration
public static Index2 operator +(Index2 i1, Index2 i2)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index2 | i1 |
|
Index2 | i2 |
|
R�ckgabewert
Typ | Beschreibung |
---|---|
Index2 |
Division(Index2, Int32)
Division eines Index2 durch einen Skalierungsfaktor
Deklaration
public static Index2 operator /(Index2 i1, int scale)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index2 | i1 | Index |
System.Int32 | scale | Skalierungsfaktor |
R�ckgabewert
Typ | Beschreibung |
---|---|
Index2 |
Equality(Index2, Index2)
Überprüft, ob beide gegebenen Indices gleich sind.
Deklaration
public static bool operator ==(Index2 i1, Index2 i2)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index2 | i1 | |
Index2 | i2 |
R�ckgabewert
Typ | Beschreibung |
---|---|
System.Boolean |
Implicit(Index2 to Vector2)
Implizite Umwandlung eines Index2 in einen Vector2. Möglicherweise entstehen dadurch Rundungsfehler.
Deklaration
public static implicit operator Vector2(Index2 index)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index2 | index |
R�ckgabewert
Typ | Beschreibung |
---|---|
Vector2 |
Inequality(Index2, Index2)
Überprüft, ob beide gegebenen Indices nicht gleich sind.
Deklaration
public static bool operator !=(Index2 i1, Index2 i2)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index2 | i1 | |
Index2 | i2 |
R�ckgabewert
Typ | Beschreibung |
---|---|
System.Boolean |
Multiply(Index2, Int32)
Multiplikation eines Index2 mit einem Skalierungsfaktor
Deklaration
public static Index2 operator *(Index2 i1, int scale)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index2 | i1 | Index |
System.Int32 | scale | Skalierungsfaktor |
R�ckgabewert
Typ | Beschreibung |
---|---|
Index2 |
Subtraction(Index2, Index2)
Subtraktion von zwei Indices2
Deklaration
public static Index2 operator -(Index2 i1, Index2 i2)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index2 | i1 | Minuend |
Index2 | i2 | Subtrahend |
R�ckgabewert
Typ | Beschreibung |
---|---|
Index2 |