Arcade
|
Provides some helpful methods that don't belong anywhere else. More...
Classes | |
class | EventDelegate< THandler > |
Static Public Member Functions | |
static string | Pluralize (this string str, int count) |
Naïve conditional pluralization of a string based on the given contextual element count. Basically just adds an 's' to the end if count isn't 1. More... | |
static string | Pluralize (this string singular, string plural, int count) |
Selects the appropriate string based on a contextual element count. More... | |
static string | ToApproxString (this TimeSpan span) |
Formats a TimeSpan into a human readable approximation. More... | |
static bool | Extends (this Type testType, Type baseType) |
Returns true if testType extends baseType. More... | |
static AStarEdge< T > | Edge< T > (T dest, float cost) |
Convenience method to produce a graph connection for use when calling AStar(). More... | |
static T[] | AStar< T > (T origin, T target, Func< T, IEnumerable< AStarEdge< T >>> adjFunc, Func< T, T, float > heuristicFunc) |
An implementation of the AStar path finding algorithm. More... | |
static void | Shuffle< T > (this T[] array, Random rand=null) |
Fisher-Yates shuffling algorithm implementation. More... | |
static uint | ReadVariableLength (this Stream stream) |
Reads an unsigned integer in the range 0 - 0x7fffffff that occupies either 2 or 4 bytes, depending on the magnitude of its value, as encoded by WriteVariableLength() . More... | |
static void | WriteVariableLength (this Stream stream, uint value) |
writes an unsigned integer in the range 0 - 0x7fffffff as either 2 or 4 bytes, depending on the magnitude of its value, to be decoded by ReadVariableLength() . More... | |
static byte[] | ReadBytes (this Stream stream, int count) |
static string | ToHexString (this byte[] bytes) |
static void | Clear (this Stream stream) |
static Stream | ClearWriteReset (this Stream stream, Action< Stream > write) |
static bool | HasAttribute< TAttribute > (this ICustomAttributeProvider obj, bool inherit) |
static TAttribute | GetAttribute< TAttribute > (this ICustomAttributeProvider obj, bool inherit) |
static IEnumerable< TAttribute > | GetAttributes< TAttribute > (this ICustomAttributeProvider obj, bool inherit) |
Provides some helpful methods that don't belong anywhere else.
|
inlinestatic |
An implementation of the AStar path finding algorithm.
T | Graph node type. |
origin | Node to start path finding from. |
target | The goal node to reach. |
adjFunc | Function returning the neighbouring connections for a node. |
heuristicFunc | Function returning the estimated cost of travelling between two nodes. |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Convenience method to produce a graph connection for use when calling AStar().
T | Graph node type. |
dest | Destination node of the connection. |
cost | Cost of taking the connection. |
|
inlinestatic |
Returns true if testType extends baseType.
|
inlinestatic |
TAttribute | : | Attribute |
|
inlinestatic |
TAttribute | : | Attribute |
|
inlinestatic |
TAttribute | : | Attribute |
|
inlinestatic |
Naïve conditional pluralization of a string based on the given contextual element count. Basically just adds an 's' to the end if count isn't 1.
str | String to conditionally pluralize. |
count | Contextual element count. |
|
inlinestatic |
Selects the appropriate string based on a contextual element count.
singular | String to use if count is 1. |
plural | String to use if count isn't 1. |
count | Contextual element count. |
|
inlinestatic |
|
inlinestatic |
Reads an unsigned integer in the range 0
- 0x7fffffff
that occupies either 2 or 4 bytes, depending on the magnitude of its value, as encoded by WriteVariableLength()
.
stream | Stream to read from. |
|
inlinestatic |
Fisher-Yates shuffling algorithm implementation.
T | Array element type. |
array | Array to shuffle. |
rand | Optional random number generator to use when shuffling. |
|
inlinestatic |
Formats a TimeSpan into a human readable approximation.
span | TimeSpan to format. |
|
inlinestatic |
|
inlinestatic |
writes an unsigned integer in the range 0
- 0x7fffffff
as either 2 or 4 bytes, depending on the magnitude of its value, to be decoded by ReadVariableLength()
.
stream | Stream to write to. |
value | Value to write. Must be no larger than 0x7fffffff . |