DeckStacker v1.0
A card manager plugin for Unity games.
 
Loading...
Searching...
No Matches
DeckStacker.DSExtensions Class Reference

Static Public Member Functions

static void FlipFacing (ref this DSCardFacing facing)
 
static void UniqueAdd< T > (this List< T > thisList_, T item_)
 
static void UniqueAdd< T > (this List< T > thisList_, List< T > itemList_)
 
static void RemoveNulls< T > (this List< T > thisList_)
 
static int LastIndex< T > (this List< T > thisList_)
 
static T RandomItem< T > (this List< T > thisList_)
 
static float GreaterMagnitudeXY (this Vector3 v3_)
 
static bool IsUpOrDown (this Vector3 v3_)
 
static bool IsLoose (this DSStackType stackType_)
 
static bool IsFan (this DSStackType stackType_)
 
static Color ClearAlpha (this Color thisColor_)
 

Detailed Description

Some useful extension methods used in the DeckStacker system.

Member Function Documentation

◆ 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

Easy way of flipping a DSCardFacing from Up to Down, or vice versa.

DSCardFacing.Mixed has no opposite, and will log a message to console.

◆ 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: