This static class defines some useful extension methods for several existing classes (e.g. Vector3, float and others).
More...
|
static void | Merge (this IDictionary target, IDictionary addHash) |
| Merges all keys from addHash into the target. Adds new keys and updates the values of existing keys in target. More...
|
|
static void | MergeStringKeys (this IDictionary target, IDictionary addHash) |
| Merges keys of type string to target Hashtable. More...
|
|
static string | ToStringFull (this IDictionary origin) |
| Helper method for debugging of IDictionary content, including type-information. Using this is not performant. More...
|
|
static string | ToStringFull< T > (this List< T > data) |
| Helper method for debugging of List<T> content. Using this is not performant. More...
|
|
static string | ToStringFull (this object[] data) |
| Helper method for debugging of object[] content. Using this is not performant. More...
|
|
static Hashtable | StripToStringKeys (this IDictionary original) |
| This method copies all string-typed keys of the original into a new Hashtable. More...
|
|
static Hashtable | StripToStringKeys (this Hashtable original) |
| This method copies all string-typed keys of the original into a new Hashtable. More...
|
|
static void | StripKeysWithNullValues (this IDictionary original) |
| Removes all keys with null values. More...
|
|
static void | StripKeysWithNullValues (this Hashtable original) |
| Removes all keys with null values. More...
|
|
static bool | Contains (this int[] target, int nr) |
| Checks if a particular integer value is in an int-array. More...
|
|
This static class defines some useful extension methods for several existing classes (e.g. Vector3, float and others).
◆ Contains()
static bool Contains |
( |
this int[] |
target, |
|
|
int |
nr |
|
) |
| |
|
static |
Checks if a particular integer value is in an int-array.
This might be useful to look up if a particular actorNumber is in the list of players of a room.
- Parameters
-
target | The array of ints to check. |
nr | The number to lookup in target. |
- Returns
- True if nr was found in target.
◆ Merge()
static void Merge |
( |
this IDictionary |
target, |
|
|
IDictionary |
addHash |
|
) |
| |
|
static |
Merges all keys from addHash into the target. Adds new keys and updates the values of existing keys in target.
- Parameters
-
target | The IDictionary to update. |
addHash | The IDictionary containing data to merge into target. |
◆ MergeStringKeys()
static void MergeStringKeys |
( |
this IDictionary |
target, |
|
|
IDictionary |
addHash |
|
) |
| |
|
static |
Merges keys of type string to target Hashtable.
Does not remove keys from target (so non-string keys CAN be in target if they were before).
- Parameters
-
target | The target IDictionary passed in plus all string-typed keys from the addHash. |
addHash | A IDictionary that should be merged partly into target to update it. |
◆ StripKeysWithNullValues() [1/2]
static void StripKeysWithNullValues |
( |
this Hashtable |
original | ) |
|
|
static |
Removes all keys with null values.
Photon properties are removed by setting their value to null. Changes the original IDictionary! Uses lock(keysWithNullValue), which should be no problem in expected use cases.
- Parameters
-
original | The IDictionary to strip of keys with null value. |
◆ StripKeysWithNullValues() [2/2]
static void StripKeysWithNullValues |
( |
this IDictionary |
original | ) |
|
|
static |
Removes all keys with null values.
Photon properties are removed by setting their value to null. Changes the original IDictionary! Uses lock(keysWithNullValue), which should be no problem in expected use cases.
- Parameters
-
original | The IDictionary to strip of keys with null value. |
◆ StripToStringKeys() [1/2]
static Hashtable StripToStringKeys |
( |
this Hashtable |
original | ) |
|
|
static |
This method copies all string-typed keys of the original into a new Hashtable.
Does not recurse (!) into hashes that might be values in the root-hash. This does not modify the original.
- Parameters
-
original | The original IDictonary to get string-typed keys from. |
- Returns
- New Hashtable containing only string-typed keys of the original.
◆ StripToStringKeys() [2/2]
static Hashtable StripToStringKeys |
( |
this IDictionary |
original | ) |
|
|
static |
This method copies all string-typed keys of the original into a new Hashtable.
Does not recurse (!) into hashes that might be values in the root-hash. This does not modify the original.
- Parameters
-
original | The original IDictonary to get string-typed keys from. |
- Returns
- New Hashtable containing only string-typed keys of the original.
◆ ToStringFull() [1/2]
static string ToStringFull |
( |
this IDictionary |
origin | ) |
|
|
static |
Helper method for debugging of IDictionary content, including type-information. Using this is not performant.
Should only be used for debugging as necessary.
- Parameters
-
origin | Some Dictionary or Hashtable. |
- Returns
- String of the content of the IDictionary.
◆ ToStringFull() [2/2]
static string ToStringFull |
( |
this object[] |
data | ) |
|
|
static |
Helper method for debugging of object[] content. Using this is not performant.
Should only be used for debugging as necessary.
- Parameters
-
- Returns
- A comma-separated string containing each value's ToString().
◆ ToStringFull< T >()
Helper method for debugging of List<T> content. Using this is not performant.
Should only be used for debugging as necessary.
- Parameters
-
data | Any List<T> where T implements .ToString(). |
- Returns
- A comma-separated string containing each value's ToString().