Some useful extension methods used in the DeckStacker system.
◆ ClearAlpha()
static Color DeckStacker.DSExtensions.ClearAlpha |
( |
this Color | thisColor_ | ) |
|
|
inlinestatic |
Returns the specified RGB color values with an alpha or 0.0.
◆ FlipFacing()
static void DeckStacker.DSExtensions.FlipFacing |
( |
ref this DSCardFacing | facing | ) |
|
|
inlinestatic |
◆ GreaterMagnitudeXY()
static float DeckStacker.DSExtensions.GreaterMagnitudeXY |
( |
this Vector3 | v3_ | ) |
|
|
inlinestatic |
More efficient than Vector3.magnitude, and just as effective for many purposes (like detecting if 2 vectors are almost the same).
This will return a float equal to the largest number in the Vector3.
◆ IsFan()
static bool DeckStacker.DSExtensions.IsFan |
( |
this DSStackType | stackType_ | ) |
|
|
inlinestatic |
A more readable way of typing "stackType_ == DSStackType.RowFan"
◆ IsLoose()
static bool DeckStacker.DSExtensions.IsLoose |
( |
this DSStackType | stackType_ | ) |
|
|
inlinestatic |
Returns if a stack type is RowLoose or ColumnLoose.
◆ IsUpOrDown()
static bool DeckStacker.DSExtensions.IsUpOrDown |
( |
this Vector3 | v3_ | ) |
|
|
inlinestatic |
Returns if the Vector3 is equal to either Vector3.up, or Vector3.down.
This is used in DSRestackHelper.
◆ LastIndex< T >()
static int DeckStacker.DSExtensions.LastIndex< T > |
( |
this List< T > | thisList_ | ) |
|
|
inlinestatic |
A more readable way of typing "List<T>.Count - 1"
◆ RandomItem< T >()
static T DeckStacker.DSExtensions.RandomItem< T > |
( |
this List< T > | thisList_ | ) |
|
|
inlinestatic |
A more readable way of typing "List<T>[Random.Range(0, thisList_.Count)]", returning a randomly selected item from the list.
◆ RemoveNulls< T >()
static void DeckStacker.DSExtensions.RemoveNulls< T > |
( |
this List< T > | thisList_ | ) |
|
|
inlinestatic |
A more readable way of typing "List<T>.RemoveAll(item => item == null)"
◆ UniqueAdd< T >() [1/2]
static void DeckStacker.DSExtensions.UniqueAdd< T > |
( |
this List< T > | thisList_, |
|
|
List< T > | itemList_ ) |
|
inlinestatic |
Adds a List of items to the list, but only adds an item to the list if that item doesn't already exist in the list.
DeckStacker has several lists that won't work well, if duplicate entries existed.
◆ UniqueAdd< T >() [2/2]
static void DeckStacker.DSExtensions.UniqueAdd< T > |
( |
this List< T > | thisList_, |
|
|
T | item_ ) |
|
inlinestatic |
Only adds an item to the list if that item doesn't already exist in the list.
DeckStacker has several lists that won't work well, if duplicate entries existed.
The documentation for this class was generated from the following file: