18 return task.Status == TaskStatus.RanToCompletion;
27 public static bool EndsWith(
this string str,
char c)
29 return str[str.Length - 1] == c;
50 public static IEnumerable<T>
SkipLast<T>(
this IEnumerable<T> e,
int count)
52 Queue<T> q =
new Queue<T>(count + 1);
56 if (q.Count == count + 1)
58 yield
return q.Dequeue();
64 if (q.Count == count + 1)
66 yield
return q.Dequeue();
81 return reference.Dereference().Unwrap<T>();
The Base Class for all BadScript Objects.
virtual BadObjectReference GetProperty(string propName, BadScope? caller=null)
Returns a Reference to the Property with the given Name.
Implements the base functionality for a BadScript Reference.
Implements Extensions that aim to fix api differences between .Net Standard and .Net/....
static IEnumerable< T > SkipLast< T >(this IEnumerable< T > e, int count)
Skips the last n elements of an IEnumerable.
static bool EndsWith(this string str, char c)
Returns true if the string ends with the given character.
static T GetProperty< T >(this BadObject obj, string propName)
Returns a Property, unwrapped to the specified type, from the given object.
static bool IsCompletedSuccessfully(this Task task)
Returns true if the Task is completed successfully.
static bool StartsWith(this string str, char c)
Returns true if the string starts with the given character.
Contains the Interop Abstractions and Implementations for the BadScript2 Language.
Contains the Runtime Objects.
Contains Utility Functions and Classes.